-
Notifications
You must be signed in to change notification settings - Fork 1
Running the app
To run the app, you must open the files in rstudio (Shiny apps do not work on the command line). The script files ui.R
and server.R
should be in a directory with the input csv file (the expected name is "FarmSurveyClean.csv") and the shape files (MAA-level_1.*). To start the app, ensure that the working directory is correct (you can use the command setwd
) and then run from the console with the command runApp(CALiPr)
Ensure that the required packages are installed - RStudio will inform you if any are needed. You may have to install an updated version of shiny - this is best done using the command install.packages('shiny')
from the console window rather than letting RStudio take care of it itself.
A yml file is included in the repository which can be used for setting up an anaconda environment with the required R packages and external programs (such as GDAL). This can be used to create an environment using the instructions found in the conda documentation. Once the conda environment has been set up, activate it using conda activate R
and then launch RStudio from this terminal window. You may still need to install some of the packages used by the app. This can be done using install.packages('<package_name>')
.
If you have need to run the app on a machine that does not have RStudio installed, you can acces the app remotely provide you are accessing from another computer on the same network.
- On the computer with RStudio installed, run the app with the command
runApp(CALiPr, port=5950, host="0.0.0.0")
- On the destination computer open the browser and navigate to :5950
You should now be able to access the app without the need for any of the R files on the destination computer