I'm trying to produce a fairly simple stacked histogram with geom_bar but the values on the vertical do not reflect the values passed to the call to ggplot.
the code I'm using:
p<-ggplot(data0, aes(x=variable, y=as.numeric(value), fill=season) )
p+geom_bar(stat='identity')+ facet_grid(specie~region) + ...
where str(data0)
reads:
'data.frame': 720 obs. of 5 variables:
$ specie : Factor w/ 5 levels "","ozone.DU",..: 3 3 3 3 4 4 4 4 5 5 ...
$ season : Factor w/ 5 levels "","autumn (SON)",..: 3 4 2 5 3 4 2 5 3 4 ...
$ region : num 1 1 1 1 1 1 1 1 1 1 ...
$ variable: Factor w/ 15 levels "3","4","5","6",..: 1 1 1 1 1 1 1 1 1 1 ...
$ value : Factor w/ 736 levels "","1.872389649",..: 28 35 20 12 26 33 19 11 5
The bars produces do not reflect any value of the dataframe, and rise constantly with the value!
the values of the bars are not what I'd expect
any suggestion is welcome. Thanks