Re: [R] Help w/an old R program I've rediscovered and want to make work
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.
Re: [R] Help w/an old R program I've rediscovered and want to make work
Hi Barry, and thanks very, very much for your comments. OK, I think I've resolved the issue of where the file is, as the program runs...and then dies. The error message I am getting now is: Error in tapply(MCP, MCPsplitlist, MCPfunction) : arguments must have same length No idea what this means. Any idea? Thanks kindly - -- View this message in context: http://r.789695.n4.nabble.com/Help-w-an-old-R-program-I-ve-rediscovered-and-want-to-make-work-tp3928890p3929021.html Sent from the R help mailing list archive at Nabble.com. __ 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.
Re: [R] Help w/an old R program I've rediscovered and want to make work
On 23/10/11 09:56, pce369 wrote: Hi Barry, and thanks very, very much for your comments. OK, I think I've resolved the issue of where the file is, as the program runs...and then dies. The error message I am getting now is: Error in tapply(MCP, MCPsplitlist, MCPfunction) : arguments must have same length No idea what this means. Any idea? Thanks kindly - Surely it means that the arguments must have the same length!!! What are the lengths of MCP, and MCPsplitlist? cheers, Rolf Turner __ 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.