Re: [R] using subset() in data frame

2008-02-23 Thread Robert Walters
Chuck Cleland wrote: > On 2/23/2008 9:13 AM, Robert Walters wrote: >> Chuck Cleland wrote: Chuck, For the record, I might add that that the following two variants for subsetting worked equally well: fit1 <- lm(pore.pct ~ Db, subset(data.b, porosity == "macro ")) fi

Re: [R] using subset() in data frame

2008-02-23 Thread Robert Walters
r goes back to the .csv file which I read into R. For some reason it's propagating a space after macro that's not visible in the file, but R picks up. In future, I'll be careful to note how R expresses variables read from external files. Sincerely, Robert Walters _

Re: [R] using subset() in data frame

2008-02-23 Thread Robert Walters
Chuck Cleland wrote: > On 2/23/2008 6:09 AM, Chuck Cleland wrote: >> On 2/22/2008 8:01 PM, Robert Walters wrote: Chuck, Thanks for the pointers on subset(). When I submit the two variants you suggested, below: > fit1 <- lm(y ~ x, subset(data.b, porosity == "macro"))

Re: [R] using subset() in data frame

2008-02-23 Thread Robert Walters
Erin Hodgess wrote: > Hi Robert! > > Could you please check > str(data.b) > > and see what you have for porosity? It needs to be a factor > > Thanks, > Erin > > Erin, Yes, porosity is a factor. See output below. > str(data.b) 'data.frame': 96 obs. of 7 variables: $ system : Factor w/

[R] using subset() in data frame

2008-02-22 Thread Robert Walters
ect=macro)) None of th above, plus many permutations thereof, works. Can anyone educate me? Thanks, Robert Walters __ 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.