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 )
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 )