繁体   English   中英

设置命令提示符目录

[英]Setting Directory of command prompt

我想在R中使用功能system2设置命令提示符的工作目录,但出现以下错误:

system2("cmd.exe", args = paste("cd", "Users/AKatherine/Downloads", sep = " "))

“ Akatherine”未被识别为内部或外部命令,可操作程序或批处理文件。

另外,我尝试运行

system2("cmd.exe", args = "java -mx150m -cp "*;" edu.stanford.nlp.parser.lexparser.LexicalizedParser -outputFormat "penn,typedDependencies" -outputFormatOptions "basicDependencies" edu/stanford/nlp/models/lexparser/englishPCFG.ser.gz ./Test/input.txt")

并得到以下错误:

错误:意外的';' 在“ system2(” cmd.exe“,args =” java -mx150m -cp“ *;”

有人知道为什么吗? 谁能帮我这个?

对于问题的第二部分,我尝试使用shell函数而不是system2函数,并且得到与在命令提示符下键入相同命令时观察到的相同输出。 我用了:

shell(cmd = "java -mx150m -cp \"*;\" edu.stanford.nlp.parser.lexparser.LexicalizedParser -outputFormat \"penn,typedDependencies\" -outputFormatOptions \"basicDependencies\" edu/stanford/nlp/models/lexparser/englishPCFG.ser.gz ./Test/input.txt", shell = "cmd.exe") 

代替

system2("cmd.exe", args = "java -mx150m -cp \"*;\" edu.stanford.nlp.parser.lexparser.LexicalizedParser -outputFormat \"penn,typedDependencies\" -outputFormatOptions \"basicDependencies\" edu/stanford/nlp/models/lexparser/englishPCFG.ser.gz ./Test/input.txt")

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM