On Sat, Oct 22, 2011 at 8:41 PM, pce369 <pce...@hotmail.com> wrote: > I found an old R program I wrote som eyears back and I'd like to make work in > 2.11.1 (or a more recent version), but am having two problems: > > 1. I can't seem to access the datafile it requires. I'm not sure where the > default place that R looks to for files references within it is, or what > exactly the format is for pulling in the data, by my own #comments from a > few years ago aren't helpful.
R will only look in the current working directory if you don't specify a full path to read.table. That's the directory you start R from, or any directory set with setwd("some/path") in an R session. Suggest you get hunting for your data set... > 2. Whether or not it's related to the problem locating the data file, the > error message I get is: > > "object of type 'closure' is not subsettable" You get that if you mistakenly try subsetting a function. I suspect this is because you try to call your data 'data' and that gets confused with the data function because the read.table fails. If you start a fresh R session and do: data$something you'll get that message. R is smart enough though, that if you do create a data frame with the name 'data' it will go for that if you do data$something... Barry ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.