I have a problem I want to draw the frequency histogram of a column using certain filters but then it tells me Error ggplot2 doesn't know how to deal with data of class numeric
.
ggplot(dataset, aes(x=perdayDiff)) + geom_histogram(binwidth=.5)
works fine but
ggplot(subset(dataset$perdayDiff, dataset$symbole == "ASYMO" & dataset$perdayDiff > 0), aes(x=perdayDiff)) + geom_histogram(binwidth=.5)
returns Error: ggplot2 doesn't know how to deal with data of class numeric
How could I draw a frequency histogram of one column of dataframe using filters on this column and others ? Using ggplot2 if possible.
Edit : I could do ggplot(subset(dataset, dataset$symbole == "AAPL" & dataset$perdayDiff > 0), aes(x=perdayDiff)) + geom_histogram(binwidth=.5)
but does it mean that ggplot2 can't handle dataframe$x
format ?