nwasc_segmentCTS: Segment CTS data from the NWASC

Description Usage Arguments Value Note on names WARNING Examples

View source: R/cts_segmentation.R

Description

This is a wrapper function that takes queries from the observations, tracks and transects.

Usage

1
2
nwasc_segmentCTS(observations, tracks, transects, seg.length = 4,
  seg.tol = 0.5, seg.min = seg.length * seg.tol, maxDist = NA)

Arguments

observations

df of observations from observation table

tracks

df of observations from tracks table (legacy translated from shapefiles)

transects

df of transect info from transect table

seg.length

numeric desired segment length

seg.tol

numeric minimal proportion of seg.length to be considered a segment

seg.min

calculated shortest length of a valid segment

maxDist

maximum distance a observation is allowed from a segment NA ignores this feature

Value

df wide format segment cts data

Note on names

The following columns are need from each of the tables. transects: "start_dt", "dataset_id", "source_dataset_id", "segmented_transect_id" (renamed from source_transect_id in query!) "transect_id", "transect_width_nb", "survey_type_cd", "survey_method_cd" tracks: (this historically was also created from shapefiles example in raw-data/) "lat", "long", "transect_id", "dataset_id, "piece", "order". observations: "transect_id", "lat", "long", "spp_cd", "count"

WARNING

double check names, with special attention to renaming source_transect_id as "segmented_transect_id"

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
seg.dat.phase2 = segmentCTS(nwasc.ph2.obs.pre,
                            nwasc.ph2.shp.pre,
                            nwasc.ph2.cts.dat,
                            seg.min = 0.0)

seg.dat.phase1.cts = segmentCTS(nwasc.ph1.obs.pre,
                                nwasc.ph1.shp.pre,
                                nwasc.ph1.cts.dat,
                                seg.min = 0.0)

## End(Not run)

robgf/nwasc documentation built on Oct. 29, 2021, 8:13 p.m.