简体   繁体   English

R运行时出现命令行错误:在字符串“'C:\\ U”中不带十六进制数字的情况下使用'\\ U'

[英]R running with Command Line Error: '\U' used without hex digits in character string starting “'C:\U”

I am using R just to plot graph calculated from another executable jar file(vdjtools-1.0.7) compiled into Java. 我正在使用R来绘制从另一个编译为Java的可执行jar文件(vdjtools-1.0.7)计算得出的图形。

For example when I run into the Command Line: 例如,当我遇到命令行时:

C:\\Users\\Lucy\\Desktop\\mixcr-1.7.1\\R\\R-3.2.4revised\\bin\\java –Xmx3g –jar vdjtools-1.0.7.jar PlotFancySpectratype inputFile.txt outputFile

It runs the program vdjtools properly because I have a correct output txt file but it doesn't give a pdf file generated by R with the plot like it should: 它会正确运行程序vdjtools,因为我有一个正确的输出txt文件,但它没有提供R生成的pdf文件,其图应为:

...[Fri Apr 01 12:00:58 CEST 2016 PlotFancySpectratype] Writing output and plotting data ... [Fri Apr 01 12:00:58 CEST 2016 PlotFancySpectratype]编写输出并绘制数据

[RUtil] Executing Rscript ebe147b7-6ae1-4d23-9d40-17832213fe29_fancy_spectratype.r Plot.fancyspectra.txt Plot.fancyspectra.pdf Clonotype TRUE [RUtil]执行Rscript ebe147b7-6ae1-4d23-9d40-17832213fe29_fancy_spectratype.r Plot.fancyspectra.txt Plot.fancyspectra.pdf Clonotype TRUE

[ERROR] Erreur : '\\U' non suivi de chiffres hexadécimaux dans la chaîne de caractères débutant ""C:\\U" Exécution arrêtée [错误]错误信息:“ \\ U”非特殊字符,但不附加““ C:\\ U”执行命令

I know that R doesn't like '\\' and it should be instead '/' or '\\' but when I write the path to directory with '/' or '\\' into the command line, it gives the same result.. 我知道R不喜欢'\\',而应该改为'/'或'\\',但是当我在命令行中将目录用'/'或'\\'写入路径时,它会得到相同的结果。 。

Hope someone can help me.. 希望可以有人帮帮我..

I will use some technical terms in my answer. 我将在回答中使用一些技术术语。 I hope you are ok with that. 希望您对此表示满意。

Well, the error is occuring because of the fact that R treats '\\' as part of escape character. 好吧,由于R将'\\'视为转义字符的一部分,因此发生了错误。 That's why it is taking '\\U' as a single unit and showing the error. 这就是为什么它将'\\ U'作为一个单位并显示错误的原因。

Solution: 解:

1) As you mentioned in your question, use '/' instead of '\\' 1)正如您在问题中提到的那样,使用'/'代替'\\'

or 要么

2) Use '\\\\' instead of '\\'. 2)使用“ \\\\”代替“ \\”。

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

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