fcas80
1
Hi. Why does the following not work, despite being one of the vignettes?
library(usmap)
library(ggplot2)
df <- data.frame(
fips = c("10001", "10003", "10005"),
values = c(93, 98, 41)
)
plot_usmap(data = df)
Error in [.data.frame
(map_df, , values) : undefined columns selected
Calls: ... scales_add_defaults -> lapply -> FUN -> [ -> [.data.frame
Execution halted
I did a copy-and-paste of your code and it worked for me! Are you sure you have the packages installed correctly? Start from a clean R session?
Stephen
> library(usmap)
> library(ggplot2)
>
> df <- data.frame(
+ fips = c("10001", "10003", "10005"),
+ values = c(93, 98, 41)
+ )
> plot_usmap(data = df)
>
>
I did start from a clean R session. No error after line one:
library(usmap)
library(ggplot2)
df <- data.frame(
- fips = c("10001", "10003", "10005"),
- values = c(93, 98, 41)
- )
plot_usmap(data = df)
Error in [.data.frame
(map_df, , values) : undefined columns selected
system
Closed
4
This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.
If you have a query related to it or one of the replies, start a new topic and refer back with a link.