From b0f22241138421c06ca0ad59ab1595dea6a9d979 Mon Sep 17 00:00:00 2001 From: rhijmans Date: Thu, 7 Nov 2024 22:52:48 -0800 Subject: [PATCH] safer --- R/lapp.R | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/R/lapp.R b/R/lapp.R index 2302e8959..35419d283 100644 --- a/R/lapp.R +++ b/R/lapp.R @@ -54,7 +54,11 @@ function(x, fun, ..., usenames=FALSE, cores=1, filename="", overwrite=FALSE, wop if (usenames) { fnames <- names(formals(fun)) - x <- x[[names(x) %in% fnames]] + i <- names(x) %in% fnames + if (!all(i)) { + warn("lapp", paste(names(x)[!i], "are not used")) + x <- x[[names(x) %in% fnames]] + } }