Re: [R] Why Numeric Values Become Factors in Data Frame

2011-11-29 Thread Rich Shepard
On Tue, 29 Nov 2011, Rich Shepard wrote: Pointers on how to determine why this one variable has some values and characters rather than as numerics are needed. Joshua, Marc, David, Bill, Sarah, Bert, et al.: Thank you all for the insights and ideas. It was a valuable lesson and it helped me

Re: [R] Why Numeric Values Become Factors in Data Frame

2011-11-29 Thread William Dunlap
rd > Sent: Tuesday, November 29, 2011 11:19 AM > To: r-help@r-project.org > Subject: [R] Why Numeric Values Become Factors in Data Frame > >I have a data frame with 1 factor, one date, and 37 numeric values: > str(waterchem) > 'data.frame': 3525 obs. of 39 varia

Re: [R] Why Numeric Values Become Factors in Data Frame

2011-11-29 Thread Marc Schwartz
On Nov 29, 2011, at 1:18 PM, Rich Shepard wrote: > I have a data frame with 1 factor, one date, and 37 numeric values: > str(waterchem) > 'data.frame': 3525 obs. of 39 variables: > site : Factor w/ 64 levels "D-1","D-2","D-3",..: 1 1 1 1 1 ... > $ sampdate : Date, format: "2007-12-12" "20

Re: [R] Why Numeric Values Become Factors in Data Frame

2011-11-29 Thread David Winsemius
On Nov 29, 2011, at 2:18 PM, Rich Shepard wrote: I have a data frame with 1 factor, one date, and 37 numeric values: str(waterchem) 'data.frame': 3525 obs. of 39 variables: site : Factor w/ 64 levels "D-1","D-2","D-3",..: 1 1 1 1 1 ... $ sampdate : Date, format: "2007-12-12" "2008-03

Re: [R] Why Numeric Values Become Factors in Data Frame

2011-11-29 Thread Joshua Wiley
Hi Rich, Try looking at: levels(waterchem$SC) There must be something in that column that is triggering R to read it as character. Potential examples include using "." to indicate missing values or anything else that is not itself directly numeric. You might also get some mileadge out of attemp

[R] Why Numeric Values Become Factors in Data Frame

2011-11-29 Thread Rich Shepard
I have a data frame with 1 factor, one date, and 37 numeric values: str(waterchem) 'data.frame': 3525 obs. of 39 variables: site : Factor w/ 64 levels "D-1","D-2","D-3",..: 1 1 1 1 1 ... $ sampdate : Date, format: "2007-12-12" "2008-03-15" ... $ CO3 : num 1 1 6.7 1 1 1 1 1 1