Question

I might just be crazy but I really can't see where I am going wrong on my simple R program. 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

Was it helpful?

Solution

Those tmp$'*_%_above_30' really work in your last line ?

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 ?

OTHER TIPS

it this because you used wrong path name? e.g., try changing "home..." to "/home..."

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top