Bug 380602

Summary: IMPLEMENTD IN SVN: function to get labels from a dataframe.
Product: [Applications] rkward Reporter: RKWard Team <rkward-devel>
Component: generalAssignee: RKWard Team <rkward-devel>
Status: RESOLVED FIXED    
Severity: wishlist    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: All   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description RKWard Team 2010-05-05 07:11:42 UTC
-- Originally posted by (AT sourceforge.net): naught101 --

-- This ticket was imported from http://sourceforge.net/p/rkward/feature-requests/68 on 2017-05-31 14:48:57 +0100 --
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 &lt;- function\(dataframe\)
\{
labelsvector &lt;- c\(\)
for \(i in 1:length\(dataframe\)\)
\{
labelsvector &lt;- c\(labelsvector,rk.get.label\(dataframe\[,i\]\)\)
\}
return\(labelsvector\)
\}-- Labels: Plugins --
Comment 1 Thomas Friedrichsmeier 2010-05-08 16:00:12 UTC
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 &lt;- function \(df\) sapply \(df, rk.get.label\)
Comment 2 Thomas Friedrichsmeier 2012-08-14 09:37:43 UTC
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 3 Thomas Friedrichsmeier 2012-08-14 09:37:43 UTC
Now implemented in the SVN version of RKWard as rk.list.labels\(\).

See http://p.sf.net/rkward/svn .
Comment 4 Thomas Friedrichsmeier 2012-08-14 09:37:43 UTC
- **assigned_to**: nobody --> tfry
- **summary**: Simple function to get labels from a dataframe. --> IMPLEMENTD IN SVN: function to get labels from a dataframe.
Comment 5 Thomas Friedrichsmeier 2012-11-21 12:09:14 UTC
Closing as the feature is officially released in 0.6.0.
Comment 6 Thomas Friedrichsmeier 2012-11-21 12:09:14 UTC
- **status**: open --> closed