Learn R Programming

sarp.snowprofile (version 1.3.2)

summary.snowprofileSet: Summarize multiple snowprofiles

Description

Wrapper for summary.snowprofile, which only returns metadata for a single snowprofile object. summary.snowprofileSet provides metadata for multiple snowprofiles, which is useful for subsetting.

Usage

# S3 method for snowprofileSet
summary(object, fast = TRUE, ...)

Value

data.frame

Arguments

object

list of snowprofile objects

fast

boolean switch to speed up computations, see summary.snowprofile

...

additional arguments for generic method

Author

shorton

See Also

summary.snowprofile, rbind.snowprofileSet

Examples

Run this code

## Extract metadata for a group of profiles
Metadata <- summary(SPgroup)
head(Metadata)

## Subsetting profiles with Metadata
Alpine <- SPgroup[Metadata$elev > 2000]
summary(Alpine)
Shallow <- SPgroup[Metadata$hs < 150]
summary(Shallow)
Week2 <- SPtimeline[summary(SPtimeline)$date > '2017-12-15']


## time comparison of fast--slow implementation
## expect 20 sec runtime
# rbenchmark::benchmark(fast = {Metadata <- summary(SPgroup, fast = TRUE)},
#                       slow = {Metadata <- summary(SPgroup, fast = FALSE)},
#                       replications = 10**3)

Run the code above in your browser using DataLab