Learn R Programming

stlcsb (version 0.1.2)

csb_projectXY: Project Calls for Service Data Using Coordinates

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

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

Run this code
# NOT RUN {
# 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)

# }

Run the code above in your browser using DataLab