Displaying 4 results from an estimated 4 matches for "waterchem".
2011 Nov 29
5
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 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 1 ...
$ HCO3 : num...
2012 Jul 05
1
reshape2 errors on data frame
I've successfully reformatted data frames from long to wide with reshape2,
but this time I'm getting errors that I want to understand and resolve.
Here's the data frame structure and the results of the melt() and dcast()
functions:
str(waterchem)
'data.frame': 128412 obs. of 8 variables:
$ site : Factor w/ 64 levels "D-1","D-2","D-3",..: 1 1 1 1 1 1 1 ...
$ sampdate: Date, format: "2007-12-12" "2007-12-12" ...
$ preeq0 : logi TRUE TRUE TRUE TRUE TRUE TRUE ...
$ param...
2012 Jun 05
0
NADA Applied to my Data
...R.
My data has been restructured with a couple of awk scripts. The data frame
structure now has a flag if the quantity is censored (ceneq1 column) as well
as a lower and upper limit for censored data. For present purposes, interval
censoring can be ignored. The data frame structure is now:
str(waterchem)
'data.frame': 46551 obs. of 7 variables:
$ site : Factor w/ 126 levels "BC-0.5","BC-1",..: 22 22 22 13 3 13 ...
$ sampdate: Date, format: "1996-05-22" "1996-07-19" ...
$ param : Factor w/ 58 levels "-0.100","AGP",..: 4...
2012 Jun 06
0
R-help Digest, Vol 112, Issue 6
...ructured with a couple of awk scripts. The data
frame
> structure now has a flag if the quantity is censored (ceneq1 column) as
well
> as a lower and upper limit for censored data. For present purposes,
interval
> censoring can be ignored. The data frame structure is now:
>
> str(waterchem)
> 'data.frame': 46551 obs. of 7 variables:
> $ site : Factor w/ 126 levels "BC-0.5","BC-1",..: 22 22 22 13 3 13
...
> $ sampdate: Date, format: "1996-05-22" "1996-07-19" ...
> $ param : Factor w/ 58 levels "-0.100"...