Skip to content

Commit 5d5fb96

Browse files
committed
Update files and fix github runs
Update tests and runs
1 parent a9eeac8 commit 5d5fb96

File tree

12 files changed

+222
-54
lines changed

12 files changed

+222
-54
lines changed

R/extractEnv.R

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
##' env_var = "rs_sst_interpolated",
8080
##' full_timeperiod = FALSE,
8181
##' fill_gaps = TRUE,
82-
##' folder_name = "test",
82+
##' buffer = 20000,
8383
##' .parallel = FALSE)
8484
##'
8585
##' @importFrom dplyr %>% mutate distinct pull left_join select
@@ -112,6 +112,10 @@ extractEnv <- function(df, X, Y, datetime,
112112
if(is.null(station_name))
113113
stop("Please provide column with station names in the 'station_name' argument.")
114114
}
115+
if (fill_gaps & is.null(buffer)) {
116+
stop("Please provide a 'buffer' size to fill gaps.")
117+
118+
}
115119
# Define spatial and temporal extent of data fetch:
116120
data_details <- ext_find(
117121
.df = df,

R/extract_func.R

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
#'
1717
#' @importFrom dplyr %>%
1818
#'
19-
#' @export
19+
#' @keywords internal
20+
2021

2122
extract_func <- function(dataset, data_details, lon.min, lon.max, lat.min, lat.max,
2223
var_name, .fill_gaps, .buffer) {
@@ -37,7 +38,7 @@ extract_func <- function(dataset, data_details, lon.min, lon.max, lat.min, lat.m
3738
}
3839
)
3940
}
40-
if (class(remote_nc) == "character") {
41+
if (inherits(remote_nc, what = "character")) {
4142
# Environmental data not available
4243
if (var_name == "rs_current") {
4344
df_exp <- data_details$unique_positions %>%
@@ -152,7 +153,7 @@ extract_func <- function(dataset, data_details, lon.min, lon.max, lat.min, lat.m
152153
remote_rast <- ("Non-regular grid!")
153154
}
154155
)
155-
if (class(remote_rast) == "character") {
156+
if (inherits(remote_rast, what = "character")) {
156157
# Use interpolation when cell sizes are not even
157158
aux_df <- remote_df[,c("LON", "LAT", var_name)]
158159
names(aux_df)[3] <- "var"

R/globals.R

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,11 @@ utils::globalVariables(c("Time",
1212
"yt_ocean",
1313
"yu_ocean",
1414
"error",
15-
"locs"
15+
"locs",
16+
"LONGITUDE",
17+
"LATITUDE",
18+
"aux",
19+
"ii",
20+
"tag_device_project_name.x",
21+
"tag_device_project_name.y"
1622
))

man/dot-extract_var.Rd

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/ext_find.Rd

Lines changed: 29 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/extractBlue.Rd

Lines changed: 0 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/extractEnv.Rd

Lines changed: 15 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/extract_func.Rd

Lines changed: 44 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/locs_match.Rd

Lines changed: 45 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/remote_open.Rd

Lines changed: 40 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)