This is the R Commands that I wrote :
ecommerce_data.df <- read.csv("https://goo.gl/hzRyFd ")
with(subset(ecommerce_data.df,
profile %in% c("Parent", "Teacher")
& productKnewWhatWanted %in% c("No", "Yes")),
hist(~ ecommerce_data.df$productKnewWhatWanted | ecommerce_data.df$profile))
but sadly, when I execute them, I have this error:
Error in hist.default(~ecommerce_data.df$productKnewWhatWanted | ecommerce_data.df$profile) :
'x' must be numeric
And I don't know how to do it since no as.numeric() or packages have helped me.
Thank you for the help !
FJCC
March 27, 2021, 1:17pm
2
The hist() function does not take a formula starting with ~, it takes a numeric vector. If you want a histogram of the TRUE and FALSE values returned by ecommerce_data.df$productKnewWhatWanted | ecommerce_data.df$profile)
, then use
hist(as.numeric(ecommerce_data.df$productKnewWhatWanted | ecommerce_data.df$profile))
system
Closed
April 17, 2021, 1:17pm
3
This topic was automatically closed 21 days after the last reply. New replies are no longer allowed. If you have a query related to it or one of the replies, start a new topic and refer back with a link.