csb_projectXY: Project Calls for Service Data Using Coordinates

Description Usage Arguments Value Examples

Description

csb_projectXY converts srx and sry data into a simple features object. You can write a shapefile directly from the output of this function using sf::st_write.

Usage

1
csb_projectXY(.data, varX, varY, crs)

Arguments

.data

A tibble or data frame

varX

Name of column containing x coordinate data

varY

Name of column containing y coordinate data

crs

Optional; coordinate reference system for the data to be projected into

Value

Returns a sf object of the input data projected as point data.

Examples

1
2
3
4
5
6
7
8
9
# remove missing coordinates prior to projecting
csb <- csb_missingXY(january_2018, srx, sry, newVar = missing)
csb <- dplyr::filter(csb, missing == FALSE)

# project data
csb_projectXY(csb, srx, sry)

# project with a custom crs
csb_projectXY(csb, srx, sry, crs = 4269)

stlcsb documentation built on May 2, 2019, 4 a.m.