2

I am using the choroplethr package in R to plot the teen pregnancy rates (per Thousand) for each county in New York. This code takes the data from an Excel file, extracts the county FIPS and teen pregnancy rates, and plots the data on a county map of New York State:

NYTeenPreg <- read.csv("file.csv", stringsAsFactors=FALSE)

county <- data.frame(region= NYTeenPreg$FIPS, value=NYTeenPreg$Teen.Birth.Rate)

county_choropleth(county, "New York Teen Pregnancy Rates by County", state_zoom= "new york") + scale_fill_brewer("Teen Birth Rate \n (per 1000)", type = "seq", palette="YlOrBr")

NY Teen Pregnancy Map

The map, itself, looks great. But is there a way I specifically label the data for one of the counties? Is there a way to put a black border specifically around that one county? For example, let's say I want to display the information for Erie County, which has a FIPS code of 36029 and the teen birth rate is 25.

1
  • Can you provide a minimal, self-contained example? Commented Mar 21, 2016 at 14:12

1 Answer 1

0

I am the package author and thank you for using choroplethr. I explain how to do that in this post: Exploring the Demographics of Ferguson, Missouri.

Sign up to request clarification or add additional context in comments.

4 Comments

Thank you for your help! Is there a way in choroplethr to plot the teen pregnancy rates inside each county? I don't need to label the county names themselves.
Please include all the relevant information in your answer. Linking to off-site resources may yield broken links in the future, losing relevant information.
The link above is a 404.
@mhit0 Thank you for reporting the error (I am the owner of that site). I believe that I have fixed the error. Please try again.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.