You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I find a constantly need to extract and work with the labels of a .sav file after I have read in the file using read_sav. The difficulty is extracting and relabeling the label attribute.
Currently I use the following function from this thread:
get_var_labels = function(data) {
a = do.call(Hmisc::llist, data)
tempout = vector("list", length(a))
for (i in 1:length(a)) {
tempout[[i]] = Hmisc::label(a[[i]])
}
b = unlist(tempout)
structure(c(b), .Names = names(data))
}
It would be handy if this function formed part of the haven package without having to be dependent on Hmisc
The text was updated successfully, but these errors were encountered:
I find a constantly need to extract and work with the labels of a
.sav
file after I have read in the file usingread_sav
. The difficulty is extracting and relabeling thelabel
attribute.Currently I use the following function from this thread:
It would be handy if this function formed part of the
haven
package without having to be dependent onHmisc
The text was updated successfully, but these errors were encountered: