snowprofileTests: Constructor for a snowprofileTests object

View source: R/snowprofileTests.R

snowprofileTestsR Documentation

Constructor for a snowprofileTests object

Description

Create a snowprofileTests object.

Usage

snowprofileTests(
  testsFrame = data.frame(type = as.character(NA), result = as.character(NA), score =
    as.double(NA), fract_char = as.character(NA), depth = as.double(NA), comment =
    as.character(NA)),
  dropNAs = TRUE
)

Arguments

testsFrame

a data.frame listing snowpack stability tests. Rows correspond to individual tests and columns describe at least the fields c("type", "result", "fract_char", "score", "depth").

  • Test type and result yield the standard 'data code' for reporting snowpack tests according to the OGRS (see Details). Following type and result combinations are allowed:

    • STV, STE, STM, STH, STN, and mixed forms STE-M, STM-H

    • CTV, CTE, CTM, CTH, CTN, and mixed forms CTE-M, CTM-H

    • DTV, DTE, DTM, DTH, DTN, and mixed forms DTE-M, DTM-H

    • ECTPV, ECTP, ECTN, ECTX

    • RB, PST, DT tests are currently not supported.

  • score: numeric, number of taps (for CT, ECT)

  • fract_char corresponds to the fracture character, e.g., SP, SC, PC, RP, BRK, ...

  • depth: vertical location of corresponding snowpack layer (from surface)

  • potential test comment column

dropNAs

Should empty, non-mandatory columns be dropped from the final snowprofileTests object?

Details

For more information, see Canadian Avalanche Association. (2016). Observation Guidelines and Recording Standards for Weather, Snowpack, and Avalanches (OGRS). Revelstoke, BC, Canada.

Value

snowprofileTests object

Author(s)

fherla

See Also

snowprofile, snowprofileLayers, snowprofileInstabilitySigns

Examples

## create a data.frame with test observations
(testsFrame <- data.frame(type = c("CT", "ST", "ECT"),
                         result = c("E-M", "M", "P"),
                         score = c(10, NA, 12),
                         fract_char = c("SP", NA, NA),
                         depth = c(40, 40, 40),
                         comment = c("some comment on first test", "", "")))

## create snowprofileTests object
tests <- snowprofileTests(testsFrame)

## create snowprofile object containing test results and check resulting object:
snowprofile(tests = tests)


sarp.snowprofile documentation built on March 31, 2023, 5:17 p.m.