Bug 380602 - IMPLEMENTD IN SVN: function to get labels from a dataframe.
Summary: IMPLEMENTD IN SVN: function to get labels from a dataframe.
Status: RESOLVED FIXED
Alias: None
Product: rkward
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified All
: NOR wishlist
Target Milestone: ---
Assignee: RKWard Team
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-05 07:11 UTC by RKWard Team
Modified: 2012-11-21 12:09 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 <- function\(dataframe\)
\{
labelsvector <- c\(\)
for \(i in 1:length\(dataframe\)\)
\{
labelsvector <- 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 <- 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