| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/shinyapp.R |
| 3 |
\name{loadSupport} |
| 4 |
\alias{loadSupport} |
| 5 |
\title{Load an app's supporting R files} |
| 6 |
\usage{ |
| 7 |
loadSupport( |
| 8 |
appDir = NULL, |
| 9 |
renv = new.env(parent = globalenv()), |
| 10 |
globalrenv = globalenv() |
| 11 |
) |
| 12 |
} |
| 13 |
\arguments{ |
| 14 |
\item{appDir}{The application directory. If \code{appDir} is \code{NULL} or |
| 15 |
not supplied, the nearest enclosing directory that is a Shiny app, starting |
| 16 |
with the current directory, is used.} |
| 17 |
|
| 18 |
\item{renv}{The environment in which the files in the \verb{R/} directory should |
| 19 |
be evaluated.} |
| 20 |
|
| 21 |
\item{globalrenv}{The environment in which \code{global.R} should be evaluated. If |
| 22 |
\code{NULL}, \code{global.R} will not be evaluated at all.} |
| 23 |
} |
| 24 |
\description{ |
| 25 |
Loads all of the supporting R files of a Shiny application. Specifically, |
| 26 |
this function loads any top-level supporting \code{.R} files in the \verb{R/} directory |
| 27 |
adjacent to the \code{app.R}/\code{server.R}/\code{ui.R} files. |
| 28 |
} |
| 29 |
\details{ |
| 30 |
Since Shiny 1.5.0, this function is called by default when running an |
| 31 |
application. If it causes problems, there are two ways to opt out. You can |
| 32 |
either place a file named \verb{_disable_autoload.R} in your R/ directory, or |
| 33 |
set \code{options(shiny.autoload.r=FALSE)}. If you set this option, it will |
| 34 |
affect any application that runs later in the same R session, potentially |
| 35 |
breaking it, so after running your application, you should unset option with |
| 36 |
\code{options(shiny.autoload.r=NULL)} |
| 37 |
|
| 38 |
The files are sourced in alphabetical order (as determined by |
| 39 |
\link{list.files}). \code{global.R} is evaluated before the supporting R files in the |
| 40 |
\verb{R/} directory. |
| 41 |
} |