-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path_dev_history.R
97 lines (80 loc) · 3 KB
/
_dev_history.R
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
library(usethis)
#Create Description file
usethis::use_description()
#Generate the documentation
devtools::document()
#Create NAMESPACE file
usethis::use_namespace()
#Then modify the description file
#to use packages
usethis::use_package('dplyr')
usethis::use_package('tidyr')
usethis::use_package('readr')
usethis::use_package('knitr')
usethis::use_package('lubridate')
usethis::use_package('ggplot2')
usethis::use_package('here')
usethis::use_package('glue')
usethis::use_package('sp')
usethis::use_package('gstat')
usethis::use_package('Rcpp')
usethis::use_package('RcppArmadillo')
usethis::use_package('brms')
usethis::use_package('bayesplot')
usethis::use_package('kableExtra')
usethis::use_package('ape')
usethis::use_package('ggnewscale')
usethis::use_package('ggpubr')
#To install cmdstanr#
install.packages("cmdstanr", repos = c("https://mc-stan.org/r-packages/", getOption("repos")))
library(cmdstanr)
install_cmdstan()
set_cmdstan_path(path = NULL)
#Create folders and script files
#The first use_r function creates the R folder automatically
file.create(here::here('make.R'))
dir.create("data")
dir.create(here::here("data", "EUCFLUX"))
dir.create(here::here("data", "Paracou"))
dir.create(here::here("data", "Uppangala"))
dir.create(here::here("data", "BCI"))
dir.create("outputs")
dir.create(here::here("outputs", "theoretical_model"))
dir.create(here::here("outputs", "clonal_analysis"))
dir.create(here::here("outputs", "tropical_analysis"))
dir.create(here::here("outputs", "theoretical_model", "figures"))
dir.create(here::here("outputs", "clonal_analysis", "figures"))
dir.create(here::here("outputs", "tropical_analysis", "figures"))
dir.create(here::here("outputs", "tropical_analysis", "Dists_Paracou"))
dir.create(here::here("outputs", "tropical_analysis", "Dists_Uppangala"))
dir.create(here::here("outputs", "tropical_analysis", "Dists_BCI"))
dir.create("C")
file.create(here::here("C", "Distance.cpp"))
file.create(here::here("C", "Distlist.cpp"))
dir.create("analyses")
dir.create(here::here("analyses", "theoretical_model"))
dir.create(here::here("analyses", "clonal_analysis"))
dir.create(here::here("analyses", "tropical_analysis"))
file.create(here::here("analyses", "theoretical_model", "theoretical_model.Rmd"))
file.create(here::here("analyses", "clonal_analysis", "clonal_analysis.Rmd"))
file.create(here::here("analyses", "tropical_analysis", "tropical_analysis.Rmd"))
usethis::use_r(name="functions_Moran.R")
usethis::use_r(name="functions_data_manip.R")
usethis::use_r(name="functions_variance_comparison.R")
usethis::use_r(name="functions_abundance_diagrams.R")
usethis::use_r(name="functions_stan.R")
#to get the pipe (writes a file in the R directory)
usethis::use_pipe()
#Update the documentation
devtools::document()
#Modify gitignore file
# Results
#usethis::use_git_ignore("*outputs")
usethis::use_git_ignore(".RData")
usethis::use_git_ignore(".txt")
# Data
usethis::use_git_ignore("*data/")
# Result files
#usethis::use_git_ignore(".html")
#usethis::use_git_ignore(".pdf")
#usethis::use_git_ignore(".docx")