-
Notifications
You must be signed in to change notification settings - Fork 5
/
setup.Rmd
51 lines (40 loc) · 1.78 KB
/
setup.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
---
title: "Set-up"
---
```{r tangle_R_files, include=FALSE, echo=FALSE}
library(stringr)
# This is moving not copying for some reason
# file.copy("landings.RData",
# "Labs/landings.RData",
# overwrite = TRUE)
library(knitr)
library(rmarkdown)
files <- dir(pattern="^Forecasting.*Rmd$")
files <- str_sub(files,1,-5)
for(fil in files){
infil = paste0(fil,".Rmd")
outfil = paste0("Labs/R_scripts/",fil,".R")
knit(infil, output = outfil, tangle=TRUE)
}
```
```{r render_Rmd_files, include=FALSE, echo=FALSE}
require(stringr)
files <- dir("Labs", pattern="*Rmd$",full.names=TRUE)
files <- str_sub(files,1,-5)
for(fil in files){
infil = paste0(fil,".Rmd")
outfil = paste0(fil,".html")
rmarkdown::render(infil, output_file=outfil)
}
```
For full set-up including R and RStudio, go to [full setup](https://rverse-tutorials.github.io/Fish-Forecast-Training-Course/set-up.html)
Set-up:
1. Go to https://github.com/eeholmes/Catch-Forecasting-Files and copy all the files into a directory.
- If GitHub Desktop works for you, then you can click 'Clone or download' and then click open in Desktop.
- If GitHub Desktop is not working for you, then click 'Clone or download' and then download a zip file and unzip on your computer.
2. Open RStudio and 'New Project' in the upper right. Then select 'From Existing Directory' and select the directory where the 'Catch-Forecasting-Files' files are.
3. Next time you open RStudio, you can select your project from the upper right..
2. Install **other packages** that we are going to be need. I have created a package on GitHub that will install the packages you need. This will probably take **awhile** as the first time you do it, many packages will be loaded.
```{r get-packages, eval=FALSE}
devtools::install_github("RVerse-Tutorials/RWorkflowsetup")
```