| assignment-immutable | R Documentation | 
Prevents modification of objects labelled with the "immutable" S3-class by intercepting assignment during S3-method dispatch and returning an error.
\method{subset}{immutable}(object, ...) <- value
## S3 replacement method for class 'immutable'
object[...] <- value
## S3 replacement method for class 'immutable'
object[[...]] <- value
## S3 replacement method for class 'immutable'
object$... <- value
## S3 replacement method for class 'immutable'
names(x) <- value
## S3 replacement method for class 'immutable'
dimnames(x) <- value
\method{colnames}{immutable}(x) <- value
\method{rownames}{immutable}(x) <- value
| object,x | An R object inherting from the "immutable" S3-class. | 
| ... | Catch subset arguments for various dimensions. | 
| value | Not used. | 
None, throws an error.
immutable_df <- immutable(data.frame(a=1:5, b=letters[1:5]))
# return immutable data.frame
immutable_df[1:4, ]
# return immutable vector
immutable_df$a
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.