xs_shift: Shift Cross Sections

Description Usage Arguments Value Examples

View source: R/xs.r

Description

Apply a horizontal and/or vertical shift to cross section data.

Usage

1
2
3
xs_shift(d, what = c("horizontal", "vertical"), shift.table,
  station.col = "Station", distance.col = "Distance",
  elevation.col = "Elevation", subtract = TRUE)

Arguments

d

The cross section data.

what

Apply a "horizontal" and/or "vertical" shift to data.

shift.table

A table of cross section stations and shift values. If what is "horizontal" ("vertical"), a two-column table is expected with the first column listing the cross section stations and the second column listing the horizontal (vertical) shift to apply to that cross section. If what = c("horizontal", "vertical"), a three-column table is expected with the second and third columns containing the horizontal and vertical shifts, respectively.

station.col

The column in d containing the cross section stations.

distance.col

The column in d containing the distance (horizontal) values.

elevation.col

The column in d containing the elevation (vertical) values.

subtract

If TRUE, values in shift.table will be subtracted from d; if FALSE, values will be added.

Value

The data frame d with cross sections shifted according to shift.table

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
simple.quasi = system.file("sample-data/SampleQuasiUnsteady.hdf",
  package = "RAStestR")

quasi.xs = read_xs(simple.quasi)
quasi.shift = data.frame(Station = "XS_800", horizontal = 5, 
  vertical = 2, stringsAsFactors = FALSE)
xs_shift(quasi.xs, "horizontal", quasi.shift)
xs_shift(quasi.xs, "horizontal", quasi.shift, subtract = FALSE)
xs_shift(quasi.xs, "vertical", quasi.shift)
xs_shift(quasi.xs, c("horizontal", "vertical"), quasi.shift)

mkoohafkan/RAStestR documentation built on July 14, 2019, 11:41 p.m.