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

[<-R Documentation

"[<-" method for class Dasst

Description

"[<-" sets to a subset of an object of class Dasst an other object of the same class

Arguments

x

An object of class Dasst.

i

An integer or logical vector. This is the subset that will be updated from the whole object.

value

An object of class Dasst that will be stored at the given subset.

Details

This method sets to a subset of an object of class Dasst an other object of the same class. Shorter objects in the expression are recycled as often as need be until they match the length of the longest object.

Value

The actual object of class Dasst that comprises the elements updated from the selected subset.

See Also

[

Examples

# Replace position 1 with the contents of position 30.
data(plantGrowth)
plantGrowth[[1]][1:10, 1:15]
plantGrowth[1] <- plantGrowth[30]
plantGrowth[[1]][1:10, 1:15]

# Add a copy of the first order at the end extending the object length
rmax <- length(plantGrowth)
rmax
plantGrowth[rmax+1] <- plantGrowth[1]
length(plantGrowth)

# Copy position 2 into position 31, moving the former position 31 to the 32.
plantgro31 <- plantGrowth[31]
plantGrowth[31] <- plantGrowth[2]
plantGrowth[32] <- plantgro31

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