getAttrib | R Documentation |
Gets and Sets an Attribute of an R Object
getAttrib(vec, name)
setAttrib(vec, name, val)
vec |
(SEXP) An R object. |
name |
(SEXP) A character of length one. |
val |
(SEXP) An R object. |
getAttrib()
returns (SEXP) the value of attribute name
.
setAttrib()
returns (SEXP) a copy of R object vec
with attribute name
set.
(SEXP)
#include <Rinternals.h> SEXP getAttrib(SEXP vec, SEXP name) SEXP setAttrib(SEXP vec, SEXP name, SEXP val)
library(base) value <- attr(vec, name, exact = TRUE) attr(vec, name) <- val
Declaration: src/include/Rinternals.h
Implementation: src/main/attrib.c
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.