From 4c508ca227ee120939cdb678c1a4a8a609e257b6 Mon Sep 17 00:00:00 2001 From: Kiri Date: Wed, 7 Aug 2024 14:32:08 -0700 Subject: [PATCH] Replace \ with function --- R/gcm.R | 6 +++--- R/historic.R | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/R/gcm.R b/R/gcm.R index 8ac2784..b3baaee 100644 --- a/R/gcm.R +++ b/R/gcm.R @@ -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)] @@ -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)] @@ -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)] diff --git a/R/historic.R b/R/historic.R index 96c1b75..682f1e0 100644 --- a/R/historic.R +++ b/R/historic.R @@ -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)]