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

0 votes

I'm trying to plot my fit in R and I I get the following error:

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

Here is my code:

exercise <- as.factor(c(10, 10, 20, 20, 10, 10, 20, 20))
time <- c("pm", "am", "am", "pm", "am", "pm", "pm", "am")
glucose <- c(71.5, 103, 83.5, 126, 125.5, 129.5, 95, 93)

fit1 <- aov(glucose ~ exercise + time)
summary(fit1)

par(mfrow = c(2, 2))
plot(fit1)
Nov 9, 2018 in Data Analytics by Ali
• 10,670 points
2,545 views

1 answer to this question.

0 votes

Make sure is a factor

time <- as.factor(c("pm", "am", "am", "pm", "am", "pm", "pm", "am"))
answered Nov 9, 2018 by Maverick
• 10,820 points

Related Questions In Data Analytics

0 votes
1 answer

How can I add x and y axis labels in ggplot2 ?

# Load a dataset(to work with) # We’ll ...READ MORE

answered May 16, 2018 in Data Analytics by zombie
• 3,750 points
266 views
0 votes
1 answer
0 votes
1 answer

By using dpylr package sum of multiple columns

Basically here we are making an equation ...READ MORE

answered Apr 5, 2018 in Data Analytics by DeepCoder786
• 1,720 points
712 views
0 votes
1 answer

How to convert a text mining termDocumentMatrix into excel or csv in R?

By assuming that all the values are ...READ MORE

answered Apr 5, 2018 in Data Analytics by DeepCoder786
• 1,720 points
376 views
0 votes
1 answer

In a dpylr pipline how to use sample and seq?

For avoiding rowwise(), I prefer to use ...READ MORE

answered Apr 6, 2018 in Data Analytics by DeepCoder786
• 1,720 points

edited Jun 9 by Gitika 156 views
0 votes
1 answer

How to create a list of Data frames?

Basically all we have to do is ...READ MORE

answered Apr 9, 2018 in Data Analytics by DeepCoder786
• 1,720 points
230 views
0 votes
1 answer

Error saying "Error in lag(x, 1) : unused argument (1)"

lag only works as expected with time-series ...READ MORE

answered Nov 16, 2018 in Data Analytics by Maverick
• 10,820 points
472 views