mutate_geocode: Geocode a dataset

Description Usage Arguments Value Author(s) See Also Examples

View source: R/mutate_geocode.R

Description

mutate_geocode geocodes a data frame and appends the new information to the data frame provided.

Usage

1
mutate_geocode(data, location, ...)

Arguments

data

a data frame

location

a character string specifying a location of interest (e.g. "Baylor University")

...

arguments to pass to geocode

Value

data with geocoded information appended as columns

Author(s)

David Kahle david.kahle@gmail.com

See Also

geocode

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
df <- data.frame(
  address = c("1600 Pennsylvania Avenue, Washington DC", "", "houston texas"),
  stringsAsFactors = FALSE
)

## Not run:  # Server response can be slow; this cuts down check time.
mutate_geocode(df, address)


library(dplyr)
df %>% mutate_geocode(address)

tbl_df(df) %>% mutate_geocode(address)

## End(Not run)

fresques/ggmap documentation built on May 28, 2019, 8:40 p.m.