Skip to content

Commit

Permalink
Replace \ with function
Browse files Browse the repository at this point in the history
  • Loading branch information
kdaust committed Aug 7, 2024
1 parent b2903fa commit 4c508ca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions R/gcm.R
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ process_one_gcm2 <- function(gcm_nm, ssps, bbox, period, max_run, dbnames = dbna
if (!needDownload) {
setorder(bnds, -numlay)

spat_match <- lapply(1:nrow(bnds), FUN = \(x){
spat_match <- lapply(1:nrow(bnds), FUN = function(x){
if (is_in_bbox(bbox, matrix(bnds[x, 2:5]))) bnds$uid[x]
})
spat_match <- spat_match[!sapply(spat_match, is.null)]
Expand Down Expand Up @@ -381,7 +381,7 @@ process_one_gcm3 <- function(gcm_nm, years, dbCon, bbox, max_run, dbnames = dbna
if (!needDownload) {
setorder(bnds, -numlay)

spat_match <- lapply(1:nrow(bnds), FUN = \(x){
spat_match <- lapply(1:nrow(bnds), FUN = function(x){
if (is_in_bbox(bbox, matrix(bnds[x, 2:5]))) bnds$uid[x]
})
spat_match <- spat_match[!sapply(spat_match, is.null)]
Expand Down Expand Up @@ -498,7 +498,7 @@ process_one_gcm4 <- function(gcm_nm, ssps, period, max_run, dbnames = dbnames_ts
if (!needDownload) {
setorder(bnds, -numlay)

spat_match <- lapply(1:nrow(bnds), FUN = \(x){
spat_match <- lapply(1:nrow(bnds), FUN = function(x){
if (is_in_bbox(bbox, matrix(bnds[x, 2:5]))) bnds$uid[x]
})
spat_match <- spat_match[!sapply(spat_match, is.null)]
Expand Down
2 changes: 1 addition & 1 deletion R/historic.R
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ process_one_historicts <- function(dataset, years, dbCon, bbox, dbnames = dbname
if (!needDownload) {
setorder(bnds, -numlay)

spat_match <- lapply(1:nrow(bnds), FUN = \(x){
spat_match <- lapply(1:nrow(bnds), FUN = function(x){
if (is_in_bbox(bbox, matrix(bnds[x, 2:5]))) bnds$uid[x]
})
spat_match <- spat_match[!sapply(spat_match, is.null)]
Expand Down

0 comments on commit 4c508ca

Please sign in to comment.