I try to plot some data using standard graphics of R and ggplot2. First I have a DF with 15 column. So I decide to using the reshape package and to melt the data. I use this code.
require(reshape)
melta <- melt(alc, id.vars = c("SERIAL"))
boxplot(alc = melta, variable~value)
But I stumble on this error
"Error in eval(expr, envir, enclos) : object 'variable' not found".
Where I made a mistake?
The structure of melta is.
'data.frame': 17108 obs. of 3 variables:
$ SERIAL: int 38029154 38043671 38090011 38092911 38096206 38097725 38098892 38098895 38098986 38099056 ...
$ variable: Factor w/ 14 levels "ALL_CATEGORIES_TOTAL",..: 1 1 1 1 1 1 1 1 1 1 ...
$ value : num 662866 1404542 889061 1203516 736608 ...
NULL
str(melta))? - Roman Luštrikboxplot(variable ~ value, data = melta), or, rather, (given your data structure)boxplot(value ~ variable, data = melta)? - Konrad Rudolph