[Dplr-commits] r1031 - pkg/dplR/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Jun 9 21:53:13 CEST 2016
Author: andybunn
Date: 2016-06-09 21:53:11 +0200 (Thu, 09 Jun 2016)
New Revision: 1031
Modified:
pkg/dplR/R/rwl.report.R
Log:
fix typos
Modified: pkg/dplR/R/rwl.report.R
===================================================================
--- pkg/dplR/R/rwl.report.R 2016-06-09 18:28:43 UTC (rev 1030)
+++ pkg/dplR/R/rwl.report.R 2016-06-09 19:53:11 UTC (rev 1031)
@@ -5,7 +5,8 @@
res <- list()
# get a summary
tmp.sum <- summary.rwl(rwl)
- res$n <- nrow(tmp.sum)
+ res$nseries <- ncol(rwl)
+ res$n <- length(rwl[!is.na(rwl)])
res$segbar <- mean(tmp.sum$year)
res$yr0 <- min(tmp.sum$first)
res$yr1 <- max(tmp.sum$last)
@@ -15,6 +16,7 @@
# missing rings
zeds <- rwl == 0
+ res$nzeros <- table(zeds)["TRUE"]
zeds <- apply(zeds,2,which)
zeds <- sapply(zeds, function(x) {as.numeric(names(x))} )
zeds <- zeds[lapply(zeds,length)>0]
@@ -38,12 +40,13 @@
else res$small <- wee
options(warn = oldw)
- res$rwl.class <- class(rwl)
+ class(res) <- "rwl.report"
res
}
print.rwl.report <- function(x, ...){
- cat("Number of dated series:",x$n,"\n")
+ cat("Number of dated series:",x$nseries,"\n")
+ cat("Number of measurements:",x$n,"\n")
cat("Avg series length:",x$segbar,"\n")
cat("Range: ", x$yr1 - x$yr0, "\n")
cat("Span: ",x$yr0, "-", x$yr1, "\n")
@@ -59,6 +62,7 @@
cat(" Series", names(x$zeros)[i],"--",tmp,"\n",
sep = " ")
}
+ cat(x$nzeros, "absent rings (", round(x$nzeros/x$n * 100, 3),"%)\n")
}
cat("-------------\n")
cat("Internal NA values listed by series \n")
More information about the Dplr-commits
mailing list