Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201867

Creating line graph using categorical data

$
0
0

Trying to display "Grades" over inspection year, and the count is just the observations in the data frame.

Creating a quick table:

table(mydata1$Grade,mydata1$Inspection.Year)

Creating a quick barchart:

ggplot(mydata1, aes(fill=Grade , x=Inspection.Year)) +
  geom_bar()

I want to do the same thing with a line graph, but no luck with

ggplot(mydata1, aes(fill=Grade , x=Inspection.Year)) +
  geom_line()

any thoughts?

Thanks!


Viewing all articles
Browse latest Browse all 201867

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>