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

View source: R/getVecOcc.R

as.vectorpointsR Documentation

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

## 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

## End(Not run)

malariaAtlas documentation built on Oct. 27, 2023, 9:07 a.m.