Re: [R] Descriptive Stats from Data Frame

2011-08-30 Thread Simon Zehnder
Hi Rich, I do not know what u really want, because it seems to me, u want to calculate the mean of all rows, where the chemical is Arsenic?? But try this to get a little more inside: mean(chemdata$quant[chemdata$param=="Arsenic"]) The vector chemdata[chemdata$param=="Arsenic",] is a logical ve

Re: [R] Descriptive Stats from Data Frame

2011-08-30 Thread Rich Shepard
On Tue, 30 Aug 2011, David Winsemius wrote: That does look more workable. You might consider changing the dates with: chemadata$samp_date <- as.Date(as.character(chemdata$sample_date) ) David, I was thinking that I needed to do this. Thank you. It's now done. Good progress for the first

Re: [R] Descriptive Stats from Data Frame

2011-08-30 Thread David Winsemius
On Aug 30, 2011, at 5:38 PM, Rich Shepard wrote: On Tue, 30 Aug 2011, David Winsemius wrote: I think you need to go back and do your input operations again with sep="|" David, Yes, that's better. I did not know of the sep option. The new results: str(chemdata) 'data.frame': 14886

Re: [R] Descriptive Stats from Data Frame

2011-08-30 Thread Rich Shepard
On Tue, 30 Aug 2011, David Winsemius wrote: I think you need to go back and do your input operations again with sep="|" David, Yes, that's better. I did not know of the sep option. The new results: str(chemdata) 'data.frame': 14886 obs. of 4 variables: $ site_id: Factor w/ 148 le

Re: [R] Descriptive Stats from Data Frame

2011-08-30 Thread David Winsemius
On Aug 30, 2011, at 5:30 PM, Rich Shepard wrote: On Tue, 30 Aug 2011, David Winsemius wrote: It appears that your original file was delimited by "|" and your used something else, perhaps the default white-space setting? David, Yes, the csv file separator is the pipe. It is _not_ a csv

Re: [R] Descriptive Stats from Data Frame

2011-08-30 Thread Rich Shepard
On Tue, 30 Aug 2011, David Winsemius wrote: It appears that your original file was delimited by "|" and your used something else, perhaps the default white-space setting? David, Yes, the csv file separator is the pipe. I think you need to go back and do your input operations again with se

Re: [R] Descriptive Stats from Data Frame

2011-08-30 Thread Rich Shepard
On Wed, 31 Aug 2011, Tal Galili wrote: It is a bit hard to read the "summary" you are using. Consider please pasting the output of: ls.str(chemdata) Tal, Yes, summary() is inappropriate. I do want str() instead. And what that shows is: str(chemdata) 'data.frame': 14886 obs. of 1 vari

Re: [R] Descriptive Stats from Data Frame

2011-08-30 Thread David Winsemius
On Aug 30, 2011, at 5:00 PM, Rich Shepard wrote: I don't find how to do what I need to do in Dalgaard or 'R Cookbook', so I'm asking here. I have a data frame with water chemistry data and I want to start exploring these data. There are three factors (site, date, chemical) associated with

Re: [R] Descriptive Stats from Data Frame

2011-08-30 Thread Tal Galili
Hi Rich, It is a bit hard to read the "summary" you are using. Consider please pasting the output of: ls.str(chemdata) Regarding your question, please start and see if this work (I'm not sure, since it seems you have made some changes to the summary output, and I am only guessing how things look

[R] Descriptive Stats from Data Frame

2011-08-30 Thread Rich Shepard
I don't find how to do what I need to do in Dalgaard or 'R Cookbook', so I'm asking here. I have a data frame with water chemistry data and I want to start exploring these data. There are three factors (site, date, chemical) associated with each measurement. The data frame looks like this: