1

Does anyone know why my data is not graphing?

data_frame

univ_apps
----------------------------
timeappreceived chr May_12_2002, March_4_2002
bs_ms_phd factor  1 for bs 2 for ms 3 for 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 I missing something from the command to graph?

MrFlick
  • 195,160
  • 17
  • 277
  • 295
James Rodriguez
  • 119
  • 3
  • 10
  • 1
    Here you store the plot to a variable. To print the plot you need to print the contents of the variable. Just type the name of the variable to implicitly print it, or call `print(univdata)` – MrFlick Jul 10 '15 at 23:57
  • Also that version of `univ_apps` looks kind of bizarre. Can you post output of `dput(univ_apps)`? – IRTFM Jul 11 '15 at 04:36

1 Answers1

0

The data frame as you shown, the "timeappreceived" is chr. I guess the data type of "yearappreceived" is the same as "timeappreceived". You should convert it to numeric. Try the 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 the way, if the appid is not numeric, you shoud convert them too. But the appid is integer, isn't it?

peterchen932
  • 103
  • 1
  • 7