0

我不知道我做错了什么,但我以前在互联网上找不到答案。也许你们中的任何人都可以帮助我修复错误。

它说意外令牌'!='。以下是代码:

args <- commandArgs(trailingOnly = TRUE) 
if((!= is.null(args[1])) && (!=is.na(args[1]))) filename = args[1] 
4

1 回答 1

1

你应该使用if((!is.null(args[1])) && (!is.na(args[1]))) filename = args[1]

!=运算符(不等于)用于左侧的测试对象和右侧的预期值if((is.null(args[1]) != TRUE)

于 2019-04-12T14:21:26.650 回答