[rkward-tracker] [ rkward-Feature Requests-2996981 ] Simple function to get labels from a dataframe.

SourceForge.net noreply at sourceforge.net
Wed May 5 08:11:42 UTC 2010


Feature Requests item #2996981, was opened at 2010-05-05 18:11
Message generated for change (Tracker Item Submitted) made by naught101
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=459010&aid=2996981&group_id=50231

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Plugins
Group: Next Release (example)
Status: Open
Priority: 5
Private: No
Submitted By: naught101 (naught101)
Assigned to: Nobody/Anonymous (nobody)
Summary: Simple function to get labels from a dataframe.

Initial Comment:
rkward stores dataframe variable labels as variable attribute metadata. It's possible to get a single label, with rk.get.label(dataframe[,x]), where x is the variable you want. It would be good to get all the labels from a dataframe, and store them as a vector. 

There might be a simpler way to do this, but this works for me:

rk.get.labels <- function(dataframe)
  {
  labelsvector <- c()
  for (i in 1:length(dataframe))
    {
    labelsvector <- c(labelsvector,rk.get.label(dataframe[,i]))
    }
  return(labelsvector)
  }

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=459010&aid=2996981&group_id=50231




More information about the rkward-tracker mailing list