bdim 发表于 2018-11-27 18:27 
不行,会出错的。
我试了试三个包,都不能用
> rm(list=ls())
> library(foreign)
> data.spss <- read.spss("car_sales.sav", to.data.frame = TRUE)
> head(data.spss)
manufact model sales resale type price engine_s horsepow wheelbas
1 Acura Integra 16.919 16.360 Automobile 21.50 1.8 140 101.2
2 Acura TL 39.384 19.875 Automobile 28.40 3.2 225 108.1
3 Acura CL 14.114 18.225 Automobile NA 3.2 225 106.9
4 Acura RL 8.588 29.725 Automobile 42.00 3.5 210 114.6
5 Audi A4 20.397 22.255 Automobile 23.99 1.8 150 102.6
6 Audi A6 18.780 23.555 Automobile 33.95 2.8 200 108.7
width length curb_wgt fuel_cap mpg lnsales zresale ztype zprice zengine_
1 67.3 172.4 2.639 13.2 28 2.828437 -0.14956062 -0.5926188 -0.41045828 -1.2070012
2 70.3 192.9 3.517 17.2 25 3.673360 0.15733558 -0.5926188 0.07032257 0.1331567
3 70.6 192.0 3.470 17.2 26 2.647167 0.01327335 -0.5926188 NA 0.1331567
4 71.4 196.6 3.850 18.0 22 2.150366 1.01734341 -0.5926188 1.01794859 0.4203334
5 68.2 178.0 2.998 16.4 27 3.015388 0.36513442 -0.5926188 -0.23695910 -1.2070012
6 76.1 192.0 3.561 18.5 22 2.932792 0.47863799 -0.5926188 0.45703760 -0.2497456
zhorsepo zwheelba zwidth zlength zcurb_wg zfuel_ca zmpg
1 -0.8103784 -0.82278892 -1.11533688 -1.1125568 -1.1721235 -1.22222719 0.9705266
2 0.6887312 0.08019843 -0.24624321 0.4136772 0.2204185 -0.19339977 0.2700372
3 0.6887312 -0.07684285 -0.15933384 0.3466718 0.1458746 -0.19339977 0.5035336
4 0.4241825 0.93083869 0.07242447 0.6891438 0.7485693 0.01236571 -0.4304523
5 -0.6340126 -0.63957410 -0.85460878 -0.6956344 -0.6027356 -0.39916525 0.7370301
6 0.2478166 0.15871907 1.43400456 0.3466718 0.2902042 0.14096914 -0.4304523
>