-1

I tried the following code

plot(start, Pinkpop_df1[3:5,])

But I get an error;

Error in xy.coords(x, y, xlabel, ylabel, log) : 'x' and 'y' lengths differ

How can I plot multiple Y variables for each x variable? (start is the x variable for which I want to plot multiple y variables in the same scatterplot)

zx8754
  • 52,746
  • 12
  • 114
  • 209
nemja
  • 459
  • 4
  • 19
  • You should probably tidy your data and map colours from the resulting `var` column. But hard to say because your code is not reproducible. – mtoto Apr 25 '16 at 09:02
  • Data is tidy, I just used the wrong approach. Found this; http://stackoverflow.com/questions/4877357/how-to-plot-all-the-columns-of-a-data-frame-in-r and it solved my problem. Thanks for the help though :) – nemja Apr 25 '16 at 09:46

1 Answers1

0

Try this:

plot(cbind(start,Pinkpop_df1[3:5,]))

There are several ways of calling plot and your tried a wrong mix of them.

moodymudskipper
  • 46,417
  • 11
  • 121
  • 167
  • Thanks for your help! Found this topic which helped me out; http://stackoverflow.com/questions/4877357/how-to-plot-all-the-columns-of-a-data-frame-in-r – nemja Apr 25 '16 at 09:47