[Dplr-commits] r1118 - in pkg/dplR: R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Jun 19 03:23:43 CEST 2018


Author: andybunn
Date: 2018-06-19 03:23:42 +0200 (Tue, 19 Jun 2018)
New Revision: 1118

Modified:
   pkg/dplR/R/powt.R
   pkg/dplR/man/powt.Rd
Log:
making powt return class rwl as well as data.frame

Modified: pkg/dplR/R/powt.R
===================================================================
--- pkg/dplR/R/powt.R	2018-06-18 16:48:56 UTC (rev 1117)
+++ pkg/dplR/R/powt.R	2018-06-19 01:23:42 UTC (rev 1118)
@@ -44,5 +44,7 @@
     }
     prec <- getprec(rwl)
     xt <- lapply(rwl, FUN = transf)
-    data.frame(xt, row.names = row.names(rwl), check.names = FALSE)
+    res <- data.frame(xt, row.names = row.names(rwl), check.names = FALSE)
+    class(res) <- c("rwl","data.frame")
+    res
 }

Modified: pkg/dplR/man/powt.Rd
===================================================================
--- pkg/dplR/man/powt.Rd	2018-06-18 16:48:56 UTC (rev 1117)
+++ pkg/dplR/man/powt.Rd	2018-06-19 01:23:42 UTC (rev 1118)
@@ -14,7 +14,10 @@
     produced by \code{\link{read.rwl}} or \code{\link{read.fh}}}
 }
 \value{
-  A \code{data.frame} containing the power transformed ring width series.
+  An object of class \code{c("rwl", "data.frame")} containing the power 
+  transformed ring width series with the series in
+  columns and the years as rows.  The series \acronym{ID}s are the
+  column names and the years are the row names.
 }
 \details{
   This procedure is a variance stabilization technique implemented after
@@ -37,6 +40,8 @@
 \examples{library(utils)
 data(gp.rwl)
 gp.pt <- powt(gp.rwl)
+hist(summary(gp.rwl)$skew)
+hist(summary(gp.pt)$skew)
 }
 \author{
   Christian Zang.  Patched and improved by Mikko Korpela.



More information about the Dplr-commits mailing list