Question
I'm attempting to create an R code below to solve the question below, but I keep receiving an error and I am not sure what
I'm attempting to create an R code below to solve the question below, but I keep receiving an error and I am not sure what I am doing incorrectly.
Question: The variable PctRural gives the percentage of the county's residents classified as rural. Without using the choropleth function, create a three-color choropleth map that differentiates urban counties (no more than 10% rural), suburban counties (between 10% and 70% rural) and rural counties (at least 70% rural).
Code:
library(GISTools) data(georgia)
plot(georgia)
georgia$category <- ifelse(georgia$PctRural <= 10, "urban", ifelse(georgia$PctRural <= 70, "suburban", "rural"))
spplot(georgia, "category", col.regions = c("red", "yellow", "green"), main = "Three-color Choropleth Map of Georgia Counties", xlab = "Longitude", ylab = "Latitude")
Error Message:
Error in seq.default(zrng[1], zrng[2], length.out = cuts + 2) :
'from' must be a finite number
In addition: Warning messages:
1: In extend.limits(range(as.numeric(z), finite = TRUE)) :
NAs introduced by coercion
2: In min(x) : no non-missing arguments to min; returning Inf
3: In max(x) : no non-missing arguments to max; returning -Inf
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started