Last active
February 25, 2016 11:48
-
-
Save cavedave/73ae79bdc69df3c7d653 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(statebins) | |
library(dplyr) | |
size<-read.csv("size.csv", header = TRUE, sep = ",", quote = "\"",dec = ".", fill = TRUE, comment.char = "") | |
i <- sapply(size, is.factor) | |
size[i] <- lapply(size[i], as.character) | |
sizeT <- mutate(size,areaT = round(area/1000)) | |
statebins_continuous(sizeT,value_col="areaT", text_color="black", font_size=3,legend_title = "50 States colored By Area", plot_title="US States Colored by 1000km squared",brewer_pal="PuRd", | |
legend_position="bottom",title_position="top") | |
csv is | |
state,area | |
Alaska,1723337 | |
Texas,695662 | |
California,423967 | |
Montana,380831 | |
New Mexico,314917 | |
Arizona,295234 | |
Nevada,286380 | |
Colorado,269601 | |
Oregon,254799 | |
Wyoming,253335 | |
Michigan,250487 | |
Minnesota,225163 | |
Utah,219882 | |
Idaho,216443 | |
Kansas,213100 | |
Nebraska,200330 | |
South Dakota,199729 | |
Washington,184661 | |
North Dakota,183108 | |
Oklahoma,181037 | |
Missouri,180540 | |
Florida,170312 | |
Wisconsin,169635 | |
Georgia,153910 | |
Illinois,149995 | |
Iowa,145746 | |
New York,141297 | |
North Carolina,139391 | |
Arkansas,137732 | |
Alabama,135767 | |
Louisiana,135659 | |
Mississippi,125438 | |
Pennsylvania,119280 | |
Ohio,116098 | |
Virginia,110787 | |
Tennessee,109153 | |
Kentucky,104656 | |
Indiana,94326 | |
Maine,91633 | |
South Carolina,82933 | |
West Virginia,62756 | |
Maryland,32131 | |
Hawaii,28313 | |
Massachusetts,27336 | |
Vermont,24906 | |
New Hampshire,24214 | |
New Jersey,22591 | |
Connecticut,14357 | |
Delaware,6446 | |
Rhode Island,4001 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment