Dasst-setter: "[[<-" method for class 'Dasst'

[[<-R Documentation

"[[<-" method for class Dasst

Description

"[[<-" sets the contents of a table from an object of class Dasst.

Arguments

x

An object of class Dasst.

i

An integer value. Position where values will be updated.

value

Any Values to be stored at the given position.

Details

This method sets the contents of the selected table stored in an object of class Dasst. Tables are internally stored and retrieved as data.frame. Rules for subset can be applied.

Value

The actual object of class Dasst.

See Also

[[

Examples

# Add a row of NA at the end of the table 1
data(plantGrowth)
rmax <- nrow(plantGrowth[[1]])
plantGrowth[[1]][rmax + 1, ] <- NA

# Edit a subset
plantGrowth[[1]][131:132,2:4]
plantGrowth[[1]][131:132,2:4] <- matrix(rep(100,6),nrow=2)
plantGrowth[[1]][131:132,2:4]

# Remove the last rows
# No need to subset left hand side. Dimension are automatically adjusted.
tail(plantGrowth[[1]])
plantGrowth[[1]] <- plantGrowth[[1]][c(-131,-132), ]
tail(plantGrowth[[1]])

# Column names are also valid
plantGrowth[[1]][129:130,"SNW1C"]
plantGrowth[[1]][129:130,"SNW1C"] <- 1100:1101
plantGrowth[[1]][129:130,"SNW1C"]

hlozza/Dasst documentation built on April 22, 2022, 6:41 p.m.