Hi,
I am new to R and I'm totally confused by this problem. I'm trying to
load
data and run a simple correlation using corr() in the boot package.
Yesterday my code worked. Today it can't find the function corr().
I've
tried searching the web and haven't found the root of my problem. Apologies
if I've missed the obvious.
My code is simple:
install.packages('RODBC')
install.packages('boot')
library(RODBC,boot)
setwd("C:/Documents and Settings/Gary Smith/My Documents/Blog/")
data = odbcConnectExcel("LafferCurve2.xls")
mydata = sqlFetch(data,"Data")
n=23
m=73
gnp=mydata[[3]][n:m]
incTaxFirst=mydata[[7]][n:m]
corr(cbind(gnp,incTax))
Here are the console messages:
> install.packages('RODBC')
Warning: package 'RODBC' is in use and will not be
installed> install.packages('boot')
trying URL
'http://cran.stat.ucla.edu/bin/windows/contrib/2.8/boot_1.2-35.zip'
Content type 'application/zip' length 779420 bytes (761 Kb)
opened URL
downloaded 761 Kb
package 'boot' successfully unpacked and MD5 sums checked
The downloaded packages are in
C:\Documents and Settings\Gary Smith\Local
Settings\Temp\RtmpRT1RUh\downloaded_packages
updating HTML package descriptions> library(RODBC,boot)
> setwd("C:/Documents and Settings/Gary Smith/My Documents/Blog/")
> data = odbcConnectExcel("LafferCurve2.xls")
> mydata = sqlFetch(data,"Data")
> n=23
> m=73
> gnp=mydata[[3]][n:m]
> incTaxFirst=mydata[[7]][n:m]
> corr(cbind(gnp,incTax))
Error: could not find function "corr"
Using search(), I see:
[1] ".GlobalEnv" "package:RODBC"
[3] "package:stats" "package:graphics"
[5] "package:grDevices" "package:utils"
[7] "package:datasets" "package:methods"
[9] "Autoloads" "package:base"
Typing "install.packages('boot')" at the prompt gets me the
same result.
Thanks for any help.
Gary
_______________________________________
"Accept no assertions without evidence." --Goompah wisdom from
"Omega" by
Jack McDevitt--
________________________________________
"Nature is complete because it does not serve itself." --"Tao De
Jing" by
Lao Tze--