as.pr.points {malariaAtlas} | R Documentation |
Convert data.frames to pr.points objects.
Description
Will create empty columns for any missing columns expected in a pr.points data.frame. This function is particularly useful for use with packages like dplyr that strip objects of their classes.
Usage
as.pr.points(x)
Arguments
x |
A data.frame |
Examples
#Download PfPR data for Nigeria and Cameroon and map the locations of these points using autoplot
## Not run:
library(dplyr)
NGA_CMR_PR <- getPR(country = c("Nigeria", "Cameroon"), species = "Pf")
# Filter the data frame then readd pr.points class so that autoplot can be used.
NGA_CMR_PR %>%
filter(year_start > 2010) %>%
as.pr.points %>%
autoplot
## End(Not run)
[Package malariaAtlas version 1.6.1 Index]