as.vectorpoints {malariaAtlas}R 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)

[Package malariaAtlas version 1.6.1 Index]