R启动脚本中的read.table

时间:2011-11-12 10:57:46

标签: r startup

.Rprofile (基于these 2个帖子。我必须删除.First<-function(){ }。):

cat(rep("\n", 50))
if(file.exists("~/algae/analysisTxt.r")){
    source("~/algae/analysisTxt.r")
    cat("algae was loaded")
}

analysisTxt.r

algae <- read.table('http://www.liaad.up.pt/~ltorgo/DataMiningWithR/DataSets/Analysis.txt',
         header=F,
         dec='.',
         col.names=c('season','size','speed','mxPH','mnO2','Cl','NO3','NH4','oPO4','PO4','Chla','a1','a2','a3','a4','a5','a6','a7'),
         na.strings=c('XXXXXXX'))

运行时,清除屏幕后,此错误会显示

Error in eval.with.vis(expr, envir, enclos) : 
  could not find function "read.table"

我该怎么办?

1 个答案:

答案 0 :(得分:3)

read.tableutils个套餐中的一项功能,那么在调用library(utils)之前,.RprofileanalysisTxt.r中的read.table如何调用{{1}} ?