-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdashboard_installation.Rmd
68 lines (49 loc) · 3.78 KB
/
dashboard_installation.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
---
output:
pdf_document: default
html_document:
df_print: paged
---
# AFAM Toolkit Dashboard
The dashboard guides you through all steps of the AFAM Toolkit process. This document will guide you throughhow to install the dashboard on your computer for offline use. If you have have and will have access to the internet, we recommend just using the dashboard online: https://sfg-ucsb.shinyapps.io/afam-dashboard/
# Installation
If you do not have R installed on your computer, you should first install R and R Studio on your computer using [these instructions](https://sfg-ucsb.github.io/fishery-manageR/).
Next you will install the AFAM package onto your computer so that you can use it in R and R Studio.
## Installling the dashboard from the internet
This is the best option and should be chosen if you have internet connectivity. This will install the AFAM package onto your computer from an online file sharing service ("Github"). This will ensure that your version of the app is the most up-to-date as possible. Note that this step requires internet connection.
If you choose this option, simply copy and paste the following code into your R Studio console and run the code.
```{r setup, echo=TRUE,eval=FALSE}
## Specify packages that are required for AFAM app. Install them if they're not installed already
list.of.packages <- c("tidyverse", "gridExtra", "pander", "shiny", "DT","devtools","readxl","stringr","LBSPR","TropFishR","lubridate","zoo","curl")
new.packages <- list.of.packages[!(list.of.packages %in% installed.packages()[,"Package"])]
if(length(new.packages) > 0 ) install.packages(new.packages, dependencies = TRUE)
## Load packages required for AFAM
lapply(list.of.packages, require, character.only = TRUE)
## Install AFAM from Github, an online file-sharing service
devtools::install_github("SFG-UCSB/afamAppPackage")
```
## Installling the dashboard from a local file on your computer
This is the option to choose if you don't internet connectivity, but do have a copy of the app file (this will be called something like "afamAppPackage_0.1.tar.gz"). This option will install the AFAM package onto your computer using this file. Note that this may mean you don't have the most up-to-date version of the app as possible.
If you choose this option, simply copy and paste the following code into your R Studio console and run the code. Note that you'll need to change the working directory to the location where you have the app file.
```{r setup2, echo=TRUE,eval=FALSE}
## Specify packages that are required for AFAM app. Install them if they're not installed already
list.of.packages <- c("tidyverse", "gridExtra", "pander", "shiny", "DT","devtools","readxl","stringr","LBSPR","TropFishR","lubridate","zoo","curl")
new.packages <- list.of.packages[!(list.of.packages %in% installed.packages()[,"Package"])]
if(length(new.packages) > 0 ) install.packages(new.packages, dependencies = TRUE)
## Load packages required for AFAM
lapply(list.of.packages, require, character.only = TRUE)
## Set your working directory to where the AFAM app file is located. Note that you'll need to change this to match the actual directory on your computer
setwd("/Users/gmcdonald/github/afamAppPackage")
## Install AFAM from your local file
devtools::install.packages("afamAppPackage_0.1.tar.gz", repos = NULL, type="source")
```
## Running the AFAM Toolkit Dashboard (does not require internet)
You now have the AFAM App Package installed on your computer! To use it, simply load the package, and run the app. You may copy and paste the following code into your R Studio console. Note that once the package is installed during the step above, you no longer need internet connectivity to run the app!
```{r setup3, echo=TRUE,eval=FALSE}
## load Shiny package
library(shiny)
## Load AFAM Package
library(afamAppPackage)
## Run AFAM App
runAFAM()
```