OpenSourceHelpCommunity / Questions

To add your question raise an issue in this repository.
MIT License
27 stars 47 forks source link

Having trouble with code in R #442

Open luckyclover88 opened 7 months ago

luckyclover88 commented 7 months ago

in s t a l l . packages ( ’ maps ’ ) l i b r a r y ( ’ maps ’ ) s t a t e s <− map data ( " s t a t e " ) a r r e s t s <− U S A r r e s t s names ( a r r e s t s ) <− t o l o w e r ( names ( a r r e s t s ) ) a r r e s t s $ r e g i o n <− t o l o w e r ( rownames ( U S A r r e s t s ) ) choro <− merge ( s t a t e s , a r r e s t s , s o r t = FALSE , by = " r e g i o n " ) choro <− choro [ order ( choro $ order ) , ] ggplot ( choro , aes ( long , l a t ) ) + geom polygon ( aes ( group = group , f i l l = a s s a u l t ) ) + coord _map( " a l b e r s " , at0 = 4 5 . 5 , l a t 1 = 2 9 . 5 )