writePro: Write snowprofileSet to a PRO file

View source: R/writePro.R

writeProR Documentation

Write snowprofileSet to a PRO file

Description

Write SNOWPACK PRO files from a snowprofileSet.

Usage

writePro(
  profiles,
  filename,
  meta = NaN,
  header_comment = "time of creation and SNOWPACK version unknown"
)

Arguments

profiles

snowprofileSet object to write.

filename

output file path ending in .pro.

meta

optional profile metadata (defaults to summary(profiles, fast = TRUE) when omitted).

header_comment

character string added to the file header.

Value

Writes a PRO file to disk; returns NULL invisibly.

See Also

snowprofilePro

Examples


## Path to example pro file
Filename <- system.file('extdata', 'example.pro', package = 'sarp.snowprofile')

## Read entire time series and plot
Profiles <- snowprofilePro(Filename)
plot(Profiles, main = 'Timeseries read from example.pro')

## Write to file
tmppath = tempfile(pattern = "written_", fileext = ".pro")
writePro(Profiles, tmppath)

## Re-read from tempfile
Profiles2 <- snowprofilePro(tmppath)
(testbool <- all(Profiles[[1]]$layers == Profiles2[[1]]$layers))
if (!testbool) stop("error in writePro re-reading!")

sarp.snowprofile documentation built on Jan. 14, 2026, 9:06 a.m.