## export an entire snowprofile object:
export.snowprofileCsv(SPpairs$A_manual, filename = file.path(tempdir(), 'file.csv'),
export.all = TRUE)
## export only the layer properties of a snowprofile object,
# and change the column order with few column names:
# All layer variables will be exported, but the three ones provided in 'variables'
# will be the first three columns of the csv table, and their column names will be changed
# accordingly.
export.snowprofileCsv(SPpairs$A_manual, filename = file.path(tempdir(), 'file.csv'),
export.all = 'Layers',
variables = list(height = 'height_top', hardness = 'hardness',
gtype = 'gt1'))
## export all layer properties of a snowprofile object plus the station ID:
export.snowprofileCsv(SPpairs$A_manual, filename = file.path(tempdir(), 'file.csv'),
export.all = 'Layers', variables = list(station_id = 'station_id'))
## check the content of the exported csv file:
csv_content <- read.csv(file.path(tempdir(), 'file.csv'))
head(csv_content)
## or re-import the csv file as snowprofile object:
csv_snowprofile <- snowprofileCsv(file.path(tempdir(), 'file.csv'))
print(csv_snowprofile)
Run the code above in your browser using DataLab