#Download PfPR data for Nigeria and Cameroon and map the locations of these points using autoplot
if (FALSE) {
# Get some data and remove rows with NAs in location or examined or positive columns.
NGA_CMR_PR <- getPR(country = c("Nigeria", "Cameroon"), species = "Pf")
complete <- complete.cases(NGA_CMR_PR[, c(4, 5, 16, 17)])
NGA_CMR_PR <- NGA_CMR_PR[complete, ]
# Extract PfPR data at those locations.
data <- extractRaster(df = NGA_CMR_PR[, c('latitude', 'longitude')],
dataset_id = 'Malaria__202206_Global_Pf_Parasite_Rate',
year=2020)
# Some rasters are stored with NA encoded as -9999
data$value[data$value == -9999] <- NA
# We can quickly plot a summary
plot((NGA_CMR_PR$positive / NGA_CMR_PR$examined) ~ data$value)
}
Run the code above in your browser using DataLab