ggplot2 - ggplot line plot not connecting points -


i'm trying create simple line plot charting number of crimes per year 2006-2015 each county in california. problem points connected, not separate lines. data frame looks so:

enter c 'data.frame':   7319 obs. of  69 variables:  $ year               : int  2006 2006 2006 2006 2006 2006 2006 2006 2006 2006 ...  $ county             : chr  "san bernardino county" "los angeles county" "alameda county" "alameda county" ...  $ nciccode           : chr  "adelanto" "agoura hills" "alameda" "alameda bart" ...  $ violent_sum        : int  136 41 221 193 545 0 7 54 297 38 ... 

trying use following:

 ggplot(calicrime, aes(x=year, y=violent_sum, color=county)) + geom_line() 

rendered plot:

rendered plot

any appreciated.


Comments

Popular posts from this blog

python - Selenium remoteWebDriver (& SauceLabs) Firefox moseMoveTo action exception -

html - How to custom Bootstrap grid height? -

transpose - Maple isnt executing function but prints function term -