我试图用外包的read.spss函数读取R中的SPSS文件 . 有两个导入实例,我将在这里反映 . 首先,当我导入1个月的数据文件时,使用命令 read.spss(spssfile,to.data.frame = T) ,它将属性作为因子变量导入,并附加了级别 . 例如,下面是变量的变量级别的输出,就像因子变量在R中的外观一样 .

52 Levels: Barrilito Bohemia Bud Light Budweiser Carta Blanca Coors Coors Light Corona ... Bocanegra

Screenshot of the output of the variable in console is in this image

现在,当我使用相同的命令 spss.get(spssfile,use.value.labels = T) 导入27个月的相同数据时,它会导入相同的属性,其中包含为该特定属性附加的级别和标签 .

Output in console of the same attribute from 27 months datafile is given in this picture

我的要求是以我附加的第一个屏幕截图中给出的格式导入数据文件的一致性,即所有属性应该作为因子变量导入,而不是像第二个屏幕截图中提到的那样单独的级别和标签 .

请要求进一步澄清 . 任何帮助将非常感激 .

非常感谢