[R] NADA Applied to my Data

Rich Shepard rshepard at appl-ecosys.com
Tue Jun 5 18:58:16 CEST 2012


   I need a nudge in the right direction to get started using NADA. I bought
Helsel's second addition and am currently reading it; NADA is installed in
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",..: 47 58 10 16 16 26 ...
  $ quant   : num  0.01 7.69 0.02 63.8 120 0.02 399 439 2 433 ...
  $ ceneq1  : int  1 0 0 0 0 0 0 0 0 0 ...
  $ low     : num  0 7.69 0.02 63.8 120 0.02 399 439 2 433 ...
  $ high    : num  0.01 7.69 0.02 63.8 120 0.02 399 439 2 433 ...

   What I want to first learn is how to specify a box plot (and whether I can
use the lattice package) for specific chemicals.

?cenboxplot shows me the arguments, but I'm not entering them correctly, or
there's a prerequisite step I need to take:

cenboxplot(waterchem$quant, waterchem$ceneq1, group='SO4', log=T, range=1.5)
Error in function (classes, fdef, mtable)  :
   unable to find an inherited method for function "ros", for signature
"numeric", "integer"

   Perhaps cenboxplot is looking for a separate data set and not a data
frame? Or, perhaps I need to melt and re-cast the data frame to the wide
format from the current narrow format? Pointers appreciated.

Rich



More information about the R-help mailing list