Re: [R] tips for looping over a category for beginner

2011-01-19 Thread Peter Ehlers
On 2011-01-18 16:27, Ben Harrison wrote: [...snip...] plot(Ozone ~ Temp, data = aq) This highlights one of the very confusing aspects of R language for me; is plot(x, y) the same as plot (y ~ x)? Seems to be, but maybe I'm missing some nuance. plot has many methods; see with methods(plo

Re: [R] tips for looping over a category for beginner

2011-01-19 Thread Ivan Calandra
Hi, If you don't find droplevels(), then you should install the latest version of R (2.12.1). It's always a good thing, even more if you're starting. Ivan Le 1/19/2011 01:27, Ben Harrison a écrit : Thanks for the reply Peter. On 18 January 2011 22:52, Peter Ehlers wrote: Since you don't

Re: [R] tips for looping over a category for beginner

2011-01-18 Thread David Winsemius
On Jan 18, 2011, at 7:32 PM, Ben Harrison wrote: On 18 January 2011 22:52, Peter Ehlers wrote: Since you don't provide data, let's borrow from the help(droplevels) page: As an aside, is it normal practice then to attach data files to questions on this mailing list? I might do that in f

Re: [R] tips for looping over a category for beginner

2011-01-18 Thread Ben Harrison
On 18 January 2011 22:52, Peter Ehlers wrote: > Since you don't provide data, let's borrow from the > help(droplevels) page: > As an aside, is it normal practice then to attach data files to questions on this mailing list? I might do that in future if it's possible and acceptable. Ben.

Re: [R] tips for looping over a category for beginner

2011-01-18 Thread Ben Harrison
Dennis, thank you for the response! Sorry for lack of clarity, I'll explain a little more below... > plot(Depth[LithClass=='sand'], Conductivity[LithClass=='sand']) >> (ad nauseum... how can I loop through them all?) >> > I have several lithology classes - sand, clay, limestone, etc... I wish to p

Re: [R] tips for looping over a category for beginner

2011-01-18 Thread Ben Harrison
Thanks for the reply Peter. On 18 January 2011 22:52, Peter Ehlers wrote: > Since you don't provide data, let's borrow from the > help(droplevels) page: > I had no joy with my R install finding droplevels exactly, but found this instead: > ??droplevels gdata::drop.levels Drop unused factor

Re: [R] tips for looping over a category for beginner

2011-01-18 Thread Peter Ehlers
On 2011-01-17 22:48, Ben Harrison wrote: hello, I am very new to R. My current data set is a mix of values and categories. It is a geoscience data set, with values per rock sample. Case in point, each sample belongs to a lithology class, and each sample has several physical property measurements

Re: [R] tips for looping over a category for beginner

2011-01-18 Thread Dennis Murphy
Hi: Your intention isn't crystal clear to me, but I'll give it a shot... On Mon, Jan 17, 2011 at 10:48 PM, Ben Harrison < b.harris...@pgrad.unimelb.edu.au> wrote: > hello, I am very new to R. > My current data set is a mix of values and categories. It is a geoscience > data set, with values per

Re: [R] tips for looping over a category for beginner

2011-01-18 Thread Ivan Calandra
Hi, First a good tip when you ask on the R list is to provide data in a way that we can readily use it. I think the best way to do it is to copy the output of dput(tc) into the email you write. There might be better ways to do what you want, but here is what I would do: #first subset what yo

[R] tips for looping over a category for beginner

2011-01-18 Thread Ben Harrison
hello, I am very new to R. My current data set is a mix of values and categories. It is a geoscience data set, with values per rock sample. Case in point, each sample belongs to a lithology class, and each sample has several physical property measurements (density, porosity...). I want to be able