Description Usage Arguments Value Author(s) Examples
Sets the row names of the data frame to the variable name listed as SubID. SubID should be text name of variable. Also keeps number of characters constant by default (numeric SubID only) and removes SubID by default
1 | dfRownames(Data, SubID = "SubID", FixedWidth = TRUE, Remove = TRUE, MaxNumDigits=NULL)
|
Data |
a data frame with a variable containing subject ID numbers |
SubID |
Text name of subject ID variable. Default is SubID |
FixedWidth |
logical. If TRUE (default), all rowames will be the same length by padding with leading 0's. Only applies to numeric SubIDs |
Remove |
logical. If TRUE (default), the subject ID variable will be removed from data frame after setting rownames |
MaxNumDigits |
Length of rowname string. If NULL, will be set to max length in data. Only applies to numeric SubIDs |
Returns data frame with rownames set (and SubID removed if requested)
John J. Curtin jjcurtin@wisc.edu
1 2 | d <- data.frame(SubID = c(1,2,3,10,20), v1=c(1,2,3,4,5), v2=c(1,NA,NA,2,4), data=1:5)
d=dfRownames(d)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.