[英]R: read.table problems
I might just be crazy but I really can't see where I am going wrong on my simple R program. 我可能只是疯了,但我真的看不到我的简单R程序在哪里出错。 I am trying to read a table from a file but every time I try to it comes back with this error:
我试图从文件中读取表,但是每次尝试返回时都会出现此错误:
./tmp.r: line 1: syntax error near unexpected token `('
./tmp.r: line 1: `tmp <- read.table("/home/Data/run1.DOC.sample_summary",header=FALSE)'
The file I am trying to read from looks something like this: 我尝试从中读取的文件如下所示:
Aim A_%_above_20 A_%_above_30 A_%_above_40
28 0.0 0.0 0.0
99 50 100.0 82.9
34 62.1 0.0 0.0
Here is my code: 这是我的代码:
tmp <- read.table("/home/Data/run1.DOC.sample_summary",header=FALSE)
names(tmp)
max_num <- max(tmp)
hist(tmp$'*_%_above_30',col=heat.colors(max_num), main='Percent in Test', xlab='Percent Covered')
Does anyone see what I am doing wrong here? 有人在这里看到我在做什么错吗? I am just not seeing it.
我只是没有看到它。 Thanks
谢谢
it this because you used wrong path name? 这是因为您使用了错误的路径名吗? eg, try changing "home..." to "/home..."
例如,尝试将“ home ...”更改为“ / home ...”
Those tmp$'*_%_above_30'
really work in your last line ? 那些
tmp$'*_%_above_30'
确实在您的最后一行有效吗?
Also, try to put comments on different part of your code to see which one is making your code crash. 另外,请尝试在代码的不同部分添加注释,以查看导致代码崩溃的原因。
Finally, maybe it's just a bad encoding of some characters in your code. 最后,也许这只是代码中某些字符的错误编码。 Try to rewrite it from scratch.
尝试从头开始重写它。
And how do you launch your script ? 以及如何启动脚本?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.