Skip to content

Commit fd66773

Browse files
committed
Format with Air and desc::desc_normalize()
1 parent e53f149 commit fd66773

15 files changed

+213
-244
lines changed

DESCRIPTION

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Authors@R: c(
77
comment = c(ORCID = "0000-0002-0061-8359")),
88
person("Curtin University of Technology", role = "cph",
99
comment = "Provided support through Adam Sparks's time."),
10-
person("Grains Research and Development Corporation", role = c("cph"),
10+
person("Grains Research and Development Corporation", role = "cph",
1111
comment = "GRDC Project CUR2210-005OPX (AAGI-CU)")
1212
)
1313
Description: Provides functions that automate downloading and importing
@@ -49,18 +49,20 @@ Suggests:
4949
VignetteBuilder:
5050
knitr
5151
ByteCompile: TRUE
52+
Config/Needs/build: moodymudskipper/devtag
5253
Config/roxyglobals/filename: globals.R
5354
Config/roxyglobals/unique: FALSE
5455
Config/roxylint: list(linters = roxylint::tidy)
5556
Config/testthat/edition: 3
5657
Config/testthat/parallel: true
5758
Encoding: UTF-8
5859
Language: en-US
59-
Roxygen: list(markdown = TRUE, roclets = c("collate", "namespace", "rd", "roxyglobals::global_roclet", "roxylint::roxylint", "devtag::dev_roclet"))
60+
Roxygen: list(markdown = TRUE, roclets = c("collate", "namespace", "rd",
61+
"roxyglobals::global_roclet", "roxylint::roxylint",
62+
"devtag::dev_roclet"))
6063
RoxygenNote: 7.3.2
6164
X-schema.org-applicationCategory: Tools
6265
X-schema.org-isPartOf: https://ropensci.org
6366
X-schema.org-keywords: anglia-cru, climate-data, cru-cl2, temperature,
6467
rainfall, elevation, data-access, wind, relative-humidity,
6568
solar-radiation, diurnal-temperature, frost
66-
Config/Needs/build: moodymudskipper/devtag

R/create_CRU_df.R

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -83,19 +83,21 @@
8383
#'
8484
#' @export
8585

86-
create_CRU_df <- function(pre = FALSE,
87-
pre_cv = FALSE,
88-
rd0 = FALSE,
89-
tmp = FALSE,
90-
dtr = FALSE,
91-
reh = FALSE,
92-
tmn = FALSE,
93-
tmx = FALSE,
94-
sunp = FALSE,
95-
frs = FALSE,
96-
wnd = FALSE,
97-
elv = FALSE,
98-
dsn) {
86+
create_CRU_df <- function(
87+
pre = FALSE,
88+
pre_cv = FALSE,
89+
rd0 = FALSE,
90+
tmp = FALSE,
91+
dtr = FALSE,
92+
reh = FALSE,
93+
tmn = FALSE,
94+
tmx = FALSE,
95+
sunp = FALSE,
96+
frs = FALSE,
97+
wnd = FALSE,
98+
elv = FALSE,
99+
dsn
100+
) {
99101
.check_vars_FALSE(
100102
pre,
101103
pre_cv,
@@ -113,7 +115,8 @@ create_CRU_df <- function(pre = FALSE,
113115

114116
.validate_dsn(dsn)
115117

116-
files <- .get_local(pre,
118+
files <- .get_local(
119+
pre,
117120
pre_cv,
118121
rd0,
119122
tmp,

R/create_CRU_stack.R

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,21 @@
3737
#'
3838
#' @export
3939

40-
create_CRU_stack <- function(pre = FALSE,
41-
pre_cv = FALSE,
42-
rd0 = FALSE,
43-
tmp = FALSE,
44-
dtr = FALSE,
45-
reh = FALSE,
46-
tmn = FALSE,
47-
tmx = FALSE,
48-
sunp = FALSE,
49-
frs = FALSE,
50-
wnd = FALSE,
51-
elv = FALSE,
52-
dsn) {
40+
create_CRU_stack <- function(
41+
pre = FALSE,
42+
pre_cv = FALSE,
43+
rd0 = FALSE,
44+
tmp = FALSE,
45+
dtr = FALSE,
46+
reh = FALSE,
47+
tmn = FALSE,
48+
tmx = FALSE,
49+
sunp = FALSE,
50+
frs = FALSE,
51+
wnd = FALSE,
52+
elv = FALSE,
53+
dsn
54+
) {
5355
.check_vars_FALSE(
5456
pre,
5557
pre_cv,
@@ -67,7 +69,8 @@ create_CRU_stack <- function(pre = FALSE,
6769

6870
.validate_dsn(dsn)
6971

70-
files <- .get_local(pre,
72+
files <- .get_local(
73+
pre,
7174
pre_cv,
7275
rd0,
7376
tmp,

R/get_CRU.R

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,21 @@
2121
#'
2222
#' @dev
2323
.get_CRU <-
24-
function(pre,
25-
pre_cv,
26-
rd0,
27-
tmp,
28-
dtr,
29-
reh,
30-
tmn,
31-
tmx,
32-
sunp,
33-
frs,
34-
wnd,
35-
elv,
36-
cache_dir) {
24+
function(
25+
pre,
26+
pre_cv,
27+
rd0,
28+
tmp,
29+
dtr,
30+
reh,
31+
tmn,
32+
tmx,
33+
sunp,
34+
frs,
35+
wnd,
36+
elv,
37+
cache_dir
38+
) {
3739
dtr_file <- "grid_10min_dtr.dat.gz"
3840
tmp_file <- "grid_10min_tmp.dat.gz"
3941
reh_file <- "grid_10min_reh.dat.gz"
@@ -70,17 +72,17 @@
7072
)
7173
names(files) <-
7274
names(object_list) <-
73-
c(
74-
"dtr_file",
75-
"tmp_file",
76-
"reh_file",
77-
"elv_file",
78-
"pre_file",
79-
"sun_file",
80-
"wnd_file",
81-
"frs_file",
82-
"rd0_file"
83-
)
75+
c(
76+
"dtr_file",
77+
"tmp_file",
78+
"reh_file",
79+
"elv_file",
80+
"pre_file",
81+
"sun_file",
82+
"wnd_file",
83+
"frs_file",
84+
"rd0_file"
85+
)
8486

8587
# filter downloaded -------------------------------------------------------
8688
# which files are being requested?
@@ -108,17 +110,17 @@
108110
},
109111
error = function(x) {
110112
manage_cache$delete_all()
111-
cli::cli_abort("The file downloads have failed.
112-
Please start the download again.")
113+
cli::cli_abort(
114+
"The file downloads have failed.
115+
Please start the download again."
116+
)
113117
}
114118
)
115119
}
116120

117121
# filter files from cache directory in case there are local files for which
118122
# we do not want data
119-
cache_dir_contents <- as.list(list.files(cache_dir,
120-
pattern = ".dat.gz$"
121-
))
123+
cache_dir_contents <- as.list(list.files(cache_dir, pattern = ".dat.gz$"))
122124

123125
files <- cache_dir_contents[cache_dir_contents %in% files]
124126

R/get_CRU_df.R

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -75,19 +75,21 @@
7575
#'
7676
#' @export
7777

78-
get_CRU_df <- function(pre = FALSE,
79-
pre_cv = FALSE,
80-
rd0 = FALSE,
81-
tmp = FALSE,
82-
dtr = FALSE,
83-
reh = FALSE,
84-
tmn = FALSE,
85-
tmx = FALSE,
86-
sunp = FALSE,
87-
frs = FALSE,
88-
wnd = FALSE,
89-
elv = FALSE,
90-
cache = FALSE) {
78+
get_CRU_df <- function(
79+
pre = FALSE,
80+
pre_cv = FALSE,
81+
rd0 = FALSE,
82+
tmp = FALSE,
83+
dtr = FALSE,
84+
reh = FALSE,
85+
tmn = FALSE,
86+
tmx = FALSE,
87+
sunp = FALSE,
88+
frs = FALSE,
89+
wnd = FALSE,
90+
elv = FALSE,
91+
cache = FALSE
92+
) {
9193
.check_vars_FALSE(
9294
pre,
9395
pre_cv,

R/get_CRU_stack.R

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,21 @@
2929
#' @export
3030

3131
get_CRU_stack <-
32-
function(pre = FALSE,
33-
pre_cv = FALSE,
34-
rd0 = FALSE,
35-
tmp = FALSE,
36-
dtr = FALSE,
37-
reh = FALSE,
38-
tmn = FALSE,
39-
tmx = FALSE,
40-
sunp = FALSE,
41-
frs = FALSE,
42-
wnd = FALSE,
43-
elv = FALSE,
44-
cache = FALSE) {
32+
function(
33+
pre = FALSE,
34+
pre_cv = FALSE,
35+
rd0 = FALSE,
36+
tmp = FALSE,
37+
dtr = FALSE,
38+
reh = FALSE,
39+
tmn = FALSE,
40+
tmx = FALSE,
41+
sunp = FALSE,
42+
frs = FALSE,
43+
wnd = FALSE,
44+
elv = FALSE,
45+
cache = FALSE
46+
) {
4547
.check_vars_FALSE(
4648
pre,
4749
pre_cv,

0 commit comments

Comments
 (0)