Robbie Turner
2005-Oct-03 21:31 UTC
[R] Error in xy.coords(x, y, xlabel, ylabel, log) : x and y lengths differ
I am currently trying to use R to construct a regression model to explain output based on temperature. I have combined my output and temp data into a notepad file. there is no problem with loading the data into R.> data.dfoutput temp 1 850 17 2 849 17 3 905 17 4 925 17 5 1043 19 6 1104 20 7 1097 18 8 979 19 9 926 18 10 1133 18 ~~ ~~ 240 1124 12 241 1344 12 242 1375 11 243 1359 12 but when I try to plot the data I keep getting this error:> plot(temp,output)Error in xy.coords(x, y, xlabel, ylabel, log) : x and y lengths differ any advice on how to over come this error would be greatly appreciated. Cheers, Robbie. [[alternative HTML version deleted]]
ecatchpole
2005-Oct-04 02:29 UTC
[R] Error in xy.coords(x, y, xlabel, ylabel, log) : x and y lengths differ
Try plot(data.df$temp, data.df$output) Ted. On 04/10/05 07:31, Robbie Turner wrote,:> I am currently trying to use R to construct a regression model to > explain output based on temperature. I have combined my output and temp > data into a notepad file. there is no problem with loading the data into > R. > >>data.df > output temp > 1 850 17 > 2 849 17 > 3 905 17 > 4 925 17 > 5 1043 19 > 6 1104 20 > 7 1097 18 > 8 979 19 > 9 926 18 > 10 1133 18 > ~~ > ~~ > 240 1124 12 > 241 1344 12 > 242 1375 11 > 243 1359 12 > > but when I try to plot the data I keep getting this error: > >>plot(temp,output) > Error in xy.coords(x, y, xlabel, ylabel, log) : > x and y lengths differ > > any advice on how to over come this error would be greatly appreciated. > > Cheers, Robbie.
Apparently Analagous Threads
- xy.coords assumes lists will have x and y components, but doesn't check (PR#13936)
- How to fix error: 'x' and 'y' lengths differ
- Question regarding error "x and y lengths differ"
- Scatter plot produces "'x' and 'y' lengths differ"
- Error em plot.xy(xy.coords(x, y), type = type, ...) : objeto 'membros' não encontrado