I have a comma separated file named foo.csv
containing the following data:
scale, serial, spawn, for, worker
5, 0.000178, 0.000288, 0.000292, 0.0003
In your example,
plot(scale, serial)
won't work because scale
and serial
are both data frames, e.g.
class(scale)
[1] "data.frame"
You could try the following and use points()
, once the plot has been generated, to plot the remaining columns. Note, I used the ylim
parameter in plot
to accommodate the range in the third column.
data <- read.csv('foo.csv', header=T)
plot(data$scale, data$serial, ylim=c(0,750))
points(data$scale, data$spawn, col='red')
points(data$scale, data$for., col='green')
points(data$scale, data$worker, col='blue')