r - how to graph using geom_area? -
does know why data not graphing?
data_frame
univ_apps ---------------------------- timeappreceived chr may_12_2002, march_4_2002 bs_ms_phd factor 1 bs 2 ms 3 phd appid int rn89 qw23 et43 sample data -------------- timeappreceived bs_ms_phd appid sept_2_1989 1 rn89 sept_2_1989 2 dq11 oct_1_2011 1 bg32
etc
univdata = ggplot(univ_apps, aes(x= yearappreceived, y= appid, fill=as.factor(bs_ms_phd))) + geom_area(position="stack")
am missing command graph?
the data frame shown, "timeappreceived" chr. guess data type of "yearappreceived" same "timeappreceived". should convert numeric. try following code.
univdata = ggplot(univ_apps, aes(x= as.integer(yearappreceived), y= appid, fill=as.factor(bs_ms_phd))) + geom_area(position="stack"); univdata
by way, if appid not numeric, shoud convert them too. appid integer, isn't it?
Comments
Post a Comment