Reputation: 113
I have a file that I formatted for ANOVA but for I cannot run the function boxplot nor aov on it. It can be downloaded from this link:
When running "boxplot(AnovaPolyg.boxplot(AnovaPolyg...Sheet1$Frequency~AnovaPolyg...Sheet1$Race)..Sheet1$Frequency~AnovaPolyg...Sheet1$Race)
or
anov.aov=aov(AnovaPolyg...Sheet1$Race~AnovaPolyg...Sheet1$Frequency)
I get the following error:
Error in boxplot.default(split(mf[[response]], mf[-response]), ...) : adding class "factor" to an invalid object
Can someone please check the data file and tell me if they spot the problem?
Upvotes: 0
Views: 8618
Reputation: 607
I just the same error when i tried to do boxplot between two binary variables. Instead when tried for boxplot between one binary and one scale variable, error is gone. Just my thoughts.
Upvotes: 0
Reputation: 1189
I don't follow your examples, but I think the issue could be when you read in the data, it is treating Frequency
as a factor. This is because on line 25838, the entry is 0,1
instead of 0.1
. Fix this, read the data back in, check to make sure it's numeric (str
will help with this), and you should be good to go.
Upvotes: 1