Learn R Programming

malariaAtlas (version 0.0.4)

as.vectorpoints: Convert data.frames to vector.points objects.

Description

Will create empty columns for any missing columns expected in a vector.points data.frame. This function is particularly useful for use with packages like dplyr that strip objects of their classes.

Usage

as.vectorpoints(x)

Arguments

x

A data.frame

Examples

Run this code
# NOT RUN {
library(dplyr)
Brazil_vec <- getVecOcc(country = "Brazil")

# Filter data.frame then readd vector points class so autoplot can be used. 
Brazil_vec %>% 
  filter(sample_method1 == 'larval collection') %>% 
  as.vectorpoints %>% 
  autoplot
# }

Run the code above in your browser using DataLab