[R] NADA package/cenboxplot() method: maximum censored percentage
Rich Shepard
rshepard at appl-ecosys.com
Mon Aug 20 19:49:15 CEST 2012
On Mon, 20 Aug 2012, William Dunlap wrote:
> You get this error if the factor given as the group argument
> has any unused factor levels. E.g.,
>
>> with(Golden, cenboxplot(Blood, BloodCen, factor(DosageGroup,levels=c("Low","High","<unused>"))))
> Error in if ((length(obs[censored])/length(obs)) > 0.8) { :
> missing value where TRUE/FALSE needed
Bill,
There are only two grouping levels: pre-mining and mining:
str(as.d)
'data.frame': 578 obs. of 8 variables:
$ site : Factor w/ 64 levels "D-1","D-2","D-3",..: 12 12 12 12 12 12 12 12 ...
$ sampdate: Date, format: "1993-01-21" "1993-02-11" ...
$ era : Factor w/ 2 levels "Mining","Pre-mining": 2 2 2 2 2 2 2 2 ...
$ param : Factor w/ 64 levels "AgDis","AgTot",..: 6 6 6 6 6 6 6 6 6 6 ...
$ quant : num 0.004 0.004 0.005 0.005 0.003 0.006 0.005 0.004 0.003 ...
$ ceneq1 : logi FALSE FALSE FALSE FALSE FALSE FALSE ...
$ floor : num 0.004 0.004 0.005 0.005 0.003 0.006 0.005 0.004 0.003 ...
$ ceiling : num 0.004 0.004 0.005 0.005 0.003 0.006 0.005 0.004 0.003 ...
> To work around it use factor(group) instead of group when calling cenboxplot.
Since era is already a factor this throws another error.
The gzipped output of dput is attached.
Thanks,
Rich
More information about the R-help
mailing list