How can I get not only variables' names from R into Excel, but also the comments of the variables' names?

Hi all,

I'm an R-beginner...

I have received a .sav-file, which I have imported into RStudio. Since I want to look at the data in Excel as well, I have converted it into an .csv-file using the write.csv function. My problem is now that in RStudio the names of the variables/column heads look like e.g. this:
KHF_07
Item KHF 7: How old are you?

However in Excel, the explanatory comment "Item KHF 7: How old are you?" is missing. Only "KHF_07" is shown. I can't work like this in Excel, because the variables' names are not self-explanatory without their comments. (I don't know, if "comment" is the tecnically correct term in R for these explanatory comments).

How can I get these explanatory comments into Excel as well, preferably in the same field as the variables' names?

Many thanks.

Hi, welcome to the forum.

This blog post may be of some help. Working with SPSS labels in R

1 Like

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.