我有一个大致遵循这种结构的函数:
TestFunc <- function(dat, point) {
if (!(point %in% c("NW", "SE", "SW")))
stop("point must be one of 'SW', 'SE', 'NW'")
point <- enquo(point)
return(dat %>% filter(point == !!point))
问题是当我包含值检查时出现以下错误:
Error in (function (x, strict = TRUE) :
the argument has already been evaluated
当我删除检查时,错误消失了。我怎样才能同时保留两者?