Skip to contents

Generate text export geometry for an uniform reach

Usage

create_uniform_reach_txt(
  abscissas,
  upstream_bed_elevation,
  slope,
  section_type,
  profile,
  section_names = paste0("Section x=", abscissas),
  singular = NULL
)

Arguments

abscissas

numeric vector of section abscissas

upstream_bed_elevation

numeric, upstream bed elevation (m)

slope

numeric, bed slope of the reach (m/m)

section_type

1-length character, type of the section: "T" for Trapezoidal, "A" for Abscissa/Elevation, "L" for Width/Elevation

profile

list or matrix, profile of the section (See details)

section_names

character vector of section names

singular

numeric vector of abscissas of singular sections (See details)

Value

A list from which each item is a section exported by create_section_txt. Names of the list are the abscissas with trailing zeros for character sorting.

Details

The abscissas of the singular parameter should match with sections abscissas defined by abscissas. singular values that don't match are silently ignored.

Examples

# Trapezoidal section
profT <- list(B = 2,S = 1, ZF = 100, ZB = 100 + 2)

# Generate a reach with 2 sections at x=1000 and 2000
create_uniform_reach_txt(abscissas = c(1000, 2000),
                         upstream_bed_elevation = 100,
                         slope = 0.001,
                         section_type = "T",
                         profile = profT)
#> Warning: 'x' is NULL so the result will be NULL
#> Error in ans[ypos] <- rep(yes, length.out = len)[ypos]: replacement has length zero