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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!