The U.S. Gasoline Market, 52 Yearly Observations, 1953-2004
Source: These data were compiled by Professor Chris Bell, Department of Economics, University of North Carolina, Asheville. Sources:
www.bea.gov and
www.bls.gov
* Year = Year, 1953-2004,
* GasExp = Total U.S. gasoline expenditure,
* Pop = U.S. total population in thousands
* GasP = Price index for gasoline,
* Income = Per capita disposable income,
* Pnc = Price index for new cars,
* Puc = Price index for used cars,
* Ppt = Price index for public transportation,
* Pd = Aggregate price index for consumer durables,
* Pn = Aggregate price index for consumer nondurables,
* Ps = Aggregate price index for consumer services.
Year,GasExp,Pop,Gasp,Income,PNC,PUC,PPT,PD,PN,PS
1953.00 7.40000 159565. 16.6680 8883.00
47.2000 26.7000 16.8000 37.7000 29.7000
19.4000
以上为数据截取,
> read.table("C:/Users/forYear/Documents/R/工作/2014Homework1_datasets/Gasoline.txt", header = FALSE, sep = "", skip = 18)
>Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, :
line 3 did not have 5 elements
因为11个变量,在txt里分为了三行排列,所以不能使用上述命令,应该怎么解决这一个问题