i'm new to stack overflow, i have a question.
When i import a dataframe from spss to R with the function read.spss
it appears in the colnames two elements: the name of the column and a "sub name" of the column like in the image below:
This "sub-colnames" refers to the column Label in SPSS (variable View) like in the image below:
My question is: Is there a function that can tell me in the console all the sub-colnames like with the function colnames(dataframe)
? Also, this function could tell me the colname and the subcolname of each column at the same time?
Thanks
According to help(read.spss)
the attribute variable.labels has the columns labels
df <- read.spss("file")
attr(df, "variable.labels")