-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
70 lines (49 loc) · 3.91 KB
/
README.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
69
70
---
title: "AFAM_Quick_Start"
author: "Sustainable Fisheries Group"
date: "March 28, 2017"
output:
html_document:
toc: yes
---
# AFAM Dashboard quick-start guide
The AFAM Toolkit Dashboard is meant to complement the [AFAM Toolkit Guidance Document](https://sfg-ucsb.github.io/afamGuidanceDocument/), a comprehensive toolkit for assessing and managing data-limited fisheries.
This following steps will guide you through installing the AFAM App on your computer, and then running the app through R Studio. 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/).
## Step 1 - Install AFAM App Package
First, install the AFAM package onto your computer so that you can use it in R and R Studio.
### Option 1 - Install package from 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 or 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)
## Load packages required for AFAM
lapply(list.of.packages, require, character.only = TRUE)
## Install AFAM from Github, an online file-sharing service
install_github("SFG-UCSB/afamAppPackage")
```
### Option 2 - Install package from a file on your computer (does not require internet)
This is the option to choose if you don't have 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 or 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, and will also need to change the file name to match the name of the file you have.
```{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")
new.packages <- list.of.packages[!(list.of.packages %in% installed.packages()[,"Package"])]
if(length(new.packages) > 0 ) install.packages(new.packages)
## 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. Note that you may need to update this file name.
install.packages("afamAppPackage_0.1.tar.gz")
```
## Step 2 - Run AFAM App (does not require internet)
You now have the AFAM App Package installed on your computer! To use it, simply load the package into your current session using the "library" function, 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 AFAM Package
library(afamAppPackage)
## Run AFAM App
runAFAM()
```