![]() ![]() You will need to ask Shiny to call the same functions before it uses percent_map in your app, but how you write these functions will change. We also ran library(maps) and library(mapproj). To use percent_map, we first ran helpers.R with the source function, and then loaded counties.rds with the readRDS function. Here it will plot the percent of white residents in the counties in the color dark green. Percent_map plots the counties data as a choropleth map. the percent of residents in the county who are White, Black, Hispanic, or AsianĬounties Set Working Directory > Choose Directory… in the RStudio menu bar.the name of each county in the United States.When you’re done, your census-app folder should look like this. Move counties.rds into the data folder.Create a new folder named data in your census-app directory.Along the way, you will build a sophisticated app that visualizes US Census data.Ĭounties.rds is a dataset of demographic data for each county in the United States, collected with the UScensus2010 R package. This lesson will show you how to load data, R Scripts, and packages to use in your Shiny apps. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |