r - 如何修复此意外令牌“!=”错误
问题描述
我不知道我做错了什么,但我以前在互联网上找不到答案。也许你们中的任何人都可以帮助我修复错误。
它说意外令牌'!='。以下是代码:
args <- commandArgs(trailingOnly = TRUE)
if((!= is.null(args[1])) && (!=is.na(args[1]))) filename = args[1]
解决方案
你应该使用if((!is.null(args[1])) && (!is.na(args[1]))) filename = args[1]
!=
运算符(不等于)用于左侧的测试对象和右侧的预期值if((is.null(args[1]) != TRUE)
推荐阅读
- informatica - 如何将源平面文件中的多行转换为单列
- arduino - Arduino loop() 中的另一个“如何运行代码 X 次”
- docker - 如何更正 nginx 单元文件中的无效转义序列
- fuzzy-search - 如何实现中文拼音和日文罗马字的模糊搜索?
- reactjs - 当禁用输入为真时如何设置默认值
- sql - 连接 2 列,其中 1 列具有唯一记录,另一列具有重复记录
- javascript - 如何将选定的下拉值传递给同一jsp页面上的url查询字符串
- gitlab - 删除或注释gitlab中多个特征文件中的一行
- javascript - 如何在每次服务调用之前运行一个方法?(Angular 7)
- linux - 从用户输入程序集中添加实数