模式 == "ALL" 中的错误:比较 (1) 仅适用于原子和列表类型



当我运行时

if(mode=="ALL") {}

它返回

模式中的错误==";ALL":比较(1(只适用于原子和列表类型

我试图从新的工作区开始,并分离一些包,但没有成功我能做什么?

mode是一个函数:

# This doesn't work...
mode == "all"
#> Error in mode == "all": comparison (1) is possible only for atomic and list types
# ...because mode is a function
is.function(mode)
#> [1] TRUE

# You need to save something to mode - and thus overwriting the function -
# before comparing it:
mode <- "all"
mode == "all"
#> [1] TRUE

创建于2022-03-29由reprex包(v2.0.1(

将其他内容另存为mode或更改变量的名称。

最新更新