forked from prioritizr/aoh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
135 lines (98 loc) · 5.35 KB
/
Makefile
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
all: test check
echo "Done!"
# admin
build:
R --slave -e "devtools::build()"
install:
R --slave -e "remotes::install_local('.', upgrade = 'never', force = TRUE)"
clean:
rm -rf docs/*
rm -rf inst/doc/*
# create built-in data
data: inst/extdata/EXAMPLE_SPECIES.zip inst/testdata/SIMULATED_SPECIES.zip builtin_data
inst/testdata/SIMULATED_SPECIES.zip: inst/scripts/test-data.R
R --slave -e "source('inst/scripts/test-data.R')"
inst/extdata/EXAMPLE_SPECIES.zip: inst/scripts/example-data.R
R --slave -e "source('inst/scripts/example-data.R')"
builtin_data: inst/scripts/builtin-data.R
R CMD BATCH --no-restore --no-save inst/scripts/builtin-data.R
# preprocess datasets
prep_jung_lvl1_habitat_data: inst/scripts/jung-lvl1-habitat-data.R
R CMD BATCH --no-restore --no-save inst/scripts/jung-lvl1-habitat-data.R
prep_jung_lvl2_habitat_data: inst/scripts/jung-lvl2-habitat-data.R
R CMD BATCH --no-restore --no-save inst/scripts/jung-lvl2-habitat-data.R
prep_jung_plvl1_habitat_data: inst/scripts/jung-plvl1-habitat-data.R
R CMD BATCH --no-restore --no-save inst/scripts/jung-plvl1-habitat-data.R
prep_lumbierres_habitat_data: inst/scripts/lumbierres-habitat-data.R
R CMD BATCH --no-restore --no-save inst/scripts/lumbierres-habitat-data.R
# process aoh data
aoh_global_data: aoh_amphibians aoh_mammals aoh_reptiles aoh_birds
aoh_amphibians:
R CMD BATCH --no-restore --no-save '--args amphibians' inst/scripts/aoh-data.R aoh-data-amphibians.Rout
aoh_birds:
R CMD BATCH --no-restore --no-save '--args birds-part-1' inst/scripts/aoh-data.R aoh-data-birds-part-1.Rout
R CMD BATCH --no-restore --no-save '--args birds-part-2' inst/scripts/aoh-data.R aoh-data-birds-part-2.Rout
R CMD BATCH --no-restore --no-save '--args birds-part-3' inst/scripts/aoh-data.R aoh-data-birds-part-3.Rout
R CMD BATCH --no-restore --no-save '--args birds-part-4' inst/scripts/aoh-data.R aoh-data-birds-part-4.Rout
R CMD BATCH --no-restore --no-save '--args birds-part-5' inst/scripts/aoh-data.R aoh-data-birds-part-5.Rout
R CMD BATCH --no-restore --no-save '--args birds-part-6' inst/scripts/aoh-data.R aoh-data-birds-part-6.Rout
aoh_mammals:
R CMD BATCH --no-restore --no-save '--args mammals' inst/scripts/aoh-data.R aoh-data-mammals.Rout
aoh_reptiles:
R CMD BATCH --no-restore --no-save '--args reptiles' inst/scripts/aoh-data.R aoh-data-reptiles.Rout
# process fraction coverage data
frc_global_data: frc_amphibians frc_mammals frc_reptiles frc_birds
frc_amphibians:
R CMD BATCH --no-restore --no-save '--args amphibians' inst/scripts/frc-data.R frc-data-amphibians.Rout
frc_birds:
R CMD BATCH --no-restore --no-save '--args birds-part-1' inst/scripts/frc-data.R frc-data-birds-part-1.Rout
R CMD BATCH --no-restore --no-save '--args birds-part-2' inst/scripts/frc-data.R frc-data-birds-part-2.Rout
R CMD BATCH --no-restore --no-save '--args birds-part-3' inst/scripts/frc-data.R frc-data-birds-part-3.Rout
R CMD BATCH --no-restore --no-save '--args birds-part-4' inst/scripts/frc-data.R frc-data-birds-part-4.Rout
R CMD BATCH --no-restore --no-save '--args birds-part-5' inst/scripts/frc-data.R frc-data-birds-part-5.Rout
R CMD BATCH --no-restore --no-save '--args birds-part-6' inst/scripts/frc-data.R frc-data-birds-part-6.Rout
frc_mammals:
R CMD BATCH --no-restore --no-save '--args mammals' inst/scripts/frc-data.R frc-data-mammals.Rout
frc_reptiles:
R CMD BATCH --no-restore --no-save '--args reptiles' inst/scripts/frc-data.R frc-data-reptiles.Rout
# documentation
docs: man readme vigns site
man:
R --slave -e "devtools::document()"
readme:
R --slave -e "rmarkdown::render('README.Rmd')"
test:
R --slave -e "devtools::test()" > test.log 2>&1
rm -f tests/testthat/Rplots.pdf
vigns:
R --slave -e "devtools::build_vignettes()"
cp -R doc inst/
quicksite:
R --slave -e "pkgdown::build_site(run_dont_run = TRUE, lazy = TRUE)"
site:
R --slave -e "pkgdown::clean_site()"
R --slave -e "pkgdown::build_site(run_dont_run = TRUE, lazy = FALSE)"
# checks
quickcheck:
echo "\n===== R CMD CHECK =====\n" > check.log 2>&1
R --slave -e "devtools::check(build_args = '--no-build-vignettes', args = '--no-build-vignettes', run_dont_test = TRUE, vignettes = FALSE)" >> check.log 2>&1
check:
echo "\n===== R CMD CHECK =====\n" > check.log 2>&1
R --slave -e "devtools::check(remote = TRUE, build_args = '--no-build-vignettes', args = '--no-build-vignettes', run_dont_test = TRUE, vignettes = FALSE)" >> check.log 2>&1
wbcheck:
R --slave -e "devtools::check_win_devel()"
solarischeck:
R --slave -e "rhub::check(platform = 'solaris-x86-patched', email = '[email protected]', show_status = FALSE)"
spellcheck:
echo "\n===== SPELL CHECK =====\n" > spell.log 2>&1
R --slave -e "devtools::spell_check()" >> spell.log 2>&1
urlcheck:
R --slave -e "urlchecker::url_check()"
examples:
echo "\n===== EXAMPLES =====\n" > examples.log 2>&1
R --slave -e "devtools::run_examples(run_dontrun = TRUE, run_donttest = TRUE);warnings()" >> examples.log 2>&1
rm -f Rplots.pdf
purl_vigns:
R --slave -e "lapply(dir('vignettes', '^.*\\\\.Rmd$$'), function(x) knitr::purl(file.path('vignettes', x), gsub('.Rmd', '.R', x, fixed = TRUE)))"
rm -f Rplots.pdf
.PHONY: initc vigns clean data docs readme site test check checkwb build purl_vigns install man spellcheck examples prep_habitat_data prep_elevation_data aoh_reptiles aoh_mammals aoh_birds aoh_amphibians aoh_global_data frc_reptiles frc_mammals frc_birds frc_amphibians frc_global_data