extract_replacemethod: "[<-" S3 Replacement method for 'smet-class' object

[<-.smetR Documentation

'[<-' S3 Replacement method for smet-class object

Description

'[<-' S3 Replacement method for smet-class object

Usage

## S3 replacement method for class 'smet'

  x[
  rows = "all",
  fields = "all",
  date.field = "timestamp",
  offset = 0,
  multiplier = 1,
  nodata = -9999,
  ...
] <- value

Arguments

x

a smet-class object

rows

rows of the x data which will be replaced.

fields

column number or fields of x which will be replaced.

date.field

field name of the Date and Time variable. Default is "timestamp". If it is not NA, it is always returned.

offset

scalar value of the unit multiplier for each new field name which is not previously present.

multiplier

scalar value of the unit multiplier for each new field name which is not previously present.

nodata

numeric value used to replce NA. It is used if no-data value is not specified in the header of x.

...

further argument for [ method

value

a object to be replaced

Value

The "replaced" smet-class object.

Note

In case fields is a character vector, the elements whose names is in value is replaced.

Author(s)

Emanuele Cordano

Examples

rm(list=ls())


 ### SMET Rifugio Vaccarone

x <- smet(system.file('examples/PIEM001114.smet',package="RSMET"))
x[,1:3]

x[,"VAR07"] <- NA
x[,"VAR08"] <- 123
 x

y <- x 

y[,1:2] <- x[,1:2]

y[,c("TSS1","TSS2"),offset=273.15] <- 0


ecor/RSMET documentation built on Aug. 30, 2023, 2:04 a.m.