[rkward-tracker] [ rkward-Feature Requests-2996981 ] IMPLEMENTD IN SVN: function to get labels from a dataframe.
SourceForge.net
noreply at sourceforge.net
Wed Nov 21 13:09:14 UTC 2012
Feature Requests item #2996981, was opened at 2010-05-05 01:11
Message generated for change (Comment added) made by tfry
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: Closed
Priority: 5
Private: No
Submitted By: naught101 (naught101)
Assigned to: Thomas Friedrichsmeier (tfry)
Summary: IMPLEMENTD IN SVN: 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)
}
----------------------------------------------------------------------
>Comment By: Thomas Friedrichsmeier (tfry)
Date: 2012-11-21 05:09
Message:
Closing as the feature is officially released in 0.6.0.
----------------------------------------------------------------------
Comment By: Thomas Friedrichsmeier (tfry)
Date: 2012-08-14 03:37
Message:
Now implemented in the SVN version of RKWard as rk.list.labels().
See http://p.sf.net/rkward/svn .
----------------------------------------------------------------------
Comment By: Thomas Friedrichsmeier (tfry)
Date: 2012-08-14 03:37
Message:
Thanks for reporting!
This is a generic message to let you know, that the requested feature is
now implemented in the development version ( http://p.sf.net/rkward/svn ).
Testing is always welcome, as are further comments on details of the
implementation.
This report will be closed, once the feature is available in an official
release.
----------------------------------------------------------------------
Comment By: Thomas Friedrichsmeier (tfry)
Date: 2010-05-08 10:00
Message:
Thanks for the suggestion. I guess it's reasonable to add something like
that. However, we really need to start documenting those functions, before
we add too much. Let's see what we can do for the next release.
Here's a one-line version of your function:
rk.get.labels <- function (df) sapply (df, rk.get.label)
----------------------------------------------------------------------
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