[R] Plot error

NatsS nsahgal at well.ox.ac.uk
Thu May 28 15:08:56 CEST 2009


I am an R amateur.

I want to plot data such that the 3 time points(a,b,c) lie on the X-axis and
the values of these times points are on Y-axis for n samples (e.g.100).

So, I have an object x, dim 100 4, it is a dataframe (when checked the
x = 
name   a       b      c
1        0.11  1.11   0.86
2           .      .       .
3           .      .       .

so when i say:

> plot(1:3, x[,2:4], type="l") ----- I get the error below

    Error in xy.coords(x, y, xlabel, ylabel, log) : 
           (list) object cannot be coerced to type 'double'

However if I do:
> plot(1:3, x[1,2:4], type="l") ------ It works for the 1st row, and each
> individual row BUT NOT ALL ROWS

Please could someone explain what is happening here?

I wonder if I need to use 'lines' for the remaining, BUT I have another
dataset y with same dimensions as x, which I want to plot on the same
graph/plot to see the difference between x and y.

View this message in context: http://www.nabble.com/Plot-error-tp23761408p23761408.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list