Last data update: 2014.03.03

R: Coerces a 'smet-class' object to a data frame
collapse.smetR Documentation

Coerces a smet-class object to a data frame

Description

Coerces a smet-class object to a data frame

Usage

collapse.smet(x, y, headers = NULL, date.field = "timestamp")

Arguments

x

first smet-class object

y

second smet-class object

headers

header attributes to check before collapsing

date.field

field name used for date and time. Default is "timestamp", as used for SMET format.

Value

a collapsed smet-class object

Examples


smet1 <- as.smet(system.file("examples/zugspitze1.smet",package="RSMET"))
smet2 <- as.smet(system.file("examples/zugspitze2.smet",package="RSMET"))

newsmet <- collapse.smet(x=smet1,y=smet2)

newsmet_ <- collapse.smet(x=smet2,y=smet1)


x <- smet(system.file('examples/PIEM001114.smet',package="RSMET"))
y <- smet(system.file('examples/PIEM001114_20160308.smet',package="RSMET"))


xy <-  collapse.smet(x,y) 

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(RSMET)
Loading required package: stringr
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/RSMET/collapse.smet.Rd_%03d_medium.png", width=480, height=480)
> ### Name: collapse.smet
> ### Title: Coerces a 'smet-class' object to a data frame
> ### Aliases: collapse.smet
> 
> ### ** Examples
> 
> 
> smet1 <- as.smet(system.file("examples/zugspitze1.smet",package="RSMET"))
> smet2 <- as.smet(system.file("examples/zugspitze2.smet",package="RSMET"))
> 
> newsmet <- collapse.smet(x=smet1,y=smet2)
> 
> newsmet_ <- collapse.smet(x=smet2,y=smet1)
> 
> 
> x <- smet(system.file('examples/PIEM001114.smet',package="RSMET"))
> y <- smet(system.file('examples/PIEM001114_20160308.smet',package="RSMET"))
> 
> 
> xy <-  collapse.smet(x,y) 
Warning message:
In collapse.smet(x, y) :
  Collapsing SMET : header mismatch!!!   fields: timestamp VW DW TA HS == timestamp TA HS   units_offset: 0 0 0 0 0 == 0 0 0   units_multiplier: 1 1 1 1 1 == 1 1 1   station_id: PIEM001114 == PIEM001114
> 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>