Learn R Programming

scanstatistics (version 0.1.0)

join_zones: Creates a new data.table from a table containing locations, adding a column for zone.

Description

Takes a data.table with containing column location and possibly other columns, and creates a new data.table with a column for zone added to the columns in the supplied table, according to the zones in the supplied list of zones. The key colums of the resulting data.table can be specified.

Usage

join_zones(locations_etc, zones, keys = c("zone"))

Arguments

locations_etc

A data.table with column location and other columns (but none for zone).

zones

A list of zones, elements being vectors of locations.

keys

Character vector of one or more column names; these columns are set as key columns in the output data.table.

Value

A new data.table with a column for zone added to the supplied table of locations etc. (not modified).

Examples

Run this code
# NOT RUN {
locs_etc <- table_creator(list(location = 1:2, duration = 1:3, stream = 1:2))
join_zones(locs_etc, list(1, 2, 1:2), keys = c("duration", "zone"))
# }

Run the code above in your browser using DataLab