Description Usage Arguments Value Author(s) Examples
Sets or retrieves the
"SASformat",
"SASiformat", or SAStype attribute of an object.
More comprehensive support for object labels, and SASformat, are
available in Frank Harrell's Hmisc package.
Note that SAStype enforces the SAS 8-character naming convention.
1 2 3 4 5 6 7 8 | SASformat(x, default)
SASformat(x) <- value
SASiformat(x, default)
SASiformat(x) <- value
SAStype(x, default)
SAStype(x) <- value
|
x |
any object |
value |
new value for the |
default |
value to return when no appropriate attribute is found. The usual return value is NULL. |
the contents of the "label", "SASformat",
"SASiformat", "SAStype" attribute of x, if any;
otherwise, the value provided by default.
Gregory R. Warnes greg@warnes.net based on code from the
Hmisc library by Frank E. Harrell, Jr. ]
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | ## Examples for vectors
fail.time <- c(10,20)
# set attributes
SASformat(fail.time) <- 'Numeric2'
SASiformat(fail.time) <- 'Numeric2'
# display individual attributes
SASformat(fail.time)
SASiformat(fail.time)
# display all attributes
attributes(fail.time)
## SAStype only applies to data frames
df <- data.frame( fail.time, day=c("Mon","Tue"), stringsAsFactors=TRUE )
SAStype(df) <- "USER"
SAStype(df)
## Example showing specification of default return value
a <- 70
label(a, default="no label")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.