> library(RODBC)
> channel <- odbcConnectExcel("foo.xls")
> sqlTables(channel)
[1] TABLE_CAT TABLE_SCHEM TABLE_NAME TABLE_TYPE REMARKS
<0 行> (或0-长度的row.names)
> # TABLE_CAT TABLE_SCHEM TABLE_NAME TABLE_TYPE REMARKS
> # C:\\Users\\...\\Documents\\foo <NA> foo$ SYSTEM TABLE <NA>
>
> foo=sqlFetch(channel, "foo")
错误于odbcTableExists(channel, sqtable) :
‘foo’: table not found on channel
> foo
错误: 找不到对象'foo'
> # year gdp ind city con
> #1 2000 0.08431279 0.09429051 0.3622000 0.006607202
> #2 2001 0.08300318 0.08441516 0.3766000 0.007220217
> #3 2002 0.09082068 0.09829292 0.3908978 0.001303356
> #4 2003 0.10025379 0.12671907 0.4053023 0.011064107
> #5 2004 0.10085040 0.11112455 0.4176001 0.015448986
> #6 2005 0.11310035 0.12082325 0.4299000 0.012044374
> #7 2006 0.12676534 0.13391125 0.4434287 0.013780144
> #8 2007 0.14162395 0.15063330 0.4588900 0.010812481
> #9 2008 0.09634668 0.09877462 0.4698913 0.010299511
>
> model1=lm(gdp~ind+city+con,data=foo)
错误于is.data.frame(data) : 找不到对象'foo'
> model1
错误: 找不到对象'model1'
> local({pkg <- select.list(sort(.packages(all.available = TRUE)),graphics=TRUE)
+ if(nchar(pkg)) library(pkg, character.only=TRUE)})
>
epoh老师,您好!
为什么在我的电脑上运行会是以上结果?


雷达卡
京公网安备 11010802022788号







