roles
Inspect role metadata carried by a PolyGeniusFrame
Description
roles() returns the named role mapping stored on a fetched PolyGeniusFrame. When role is omitted, the full mapping is returned. When one or more role names are supplied, only those mappings are returned.
Roles are metadata only. Use ordinary data-frame access such as frame[[…]] or frame[, …, drop = FALSE] to retrieve the underlying values.
roles(x) <- value replaces the full role mapping on a PolyGeniusFrame. roles(x, “outcomes”) <- “y” replaces one named role, and roles(x, c(“outcomes”, “predictors”)) <- list(…) replaces several.
Role values must be character vectors naming columns present on the frame.
Usage
roles(x, role = NULL, ...)
roles(x, role = NULL) <- value
## S3 method for class 'PolyGeniusFrame'
roles(x, role = NULL, ...)
## Default S3 method:
roles(x, role = NULL, ...)
## S3 replacement method for class 'PolyGeniusFrame'
roles(x, role = NULL) <- value
## Default S3 replacement method:
roles(x, role = NULL) <- value
Arguments
x
|
A |
role
|
Optional role name or character vector of role names. |
…
|
Unused. Present for S3 compatibility. |
value
|
Replacement role mapping. |
Value
-
When
role = NULL, a named list of role mappings. -
When
rolehas length one, a character vector of column names. -
When
rolehas length greater than one, a named list of character vectors.
x, with updated role metadata.