graphing - Plotting in R; cannot be coerced to double error -



graphing - Plotting in R; cannot be coerced to double error -

i trying plot , b, each consisting of 7500 info points. when tried plot(x,y), got next error:

> plot(a[11],b[11]) error in xy.coords(x, y, xlabel, ylabel, log) : (list) object cannot coerced type 'double'

which strange,because values whole numbers. can do?

thank you.

it looks you're trying plot vector list. seek subseting using $ or [[]] instead.

here's problem:

a <- as.list(data.frame("x"=1:5,"y"=5:1)) b <- as.list(data.frame("x"=1:5,"y"=5:1)) plot(a[2],b[2]) ## recreates error

here's solution:

plot(a$y, b$y) ## plots expected subsetting $

alternatively, if you'd prefer stick numbers:

plot(a[[2]],b[[2]])

i recommend read help page associated this:

?'['

r graphing

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -