[Dplr-commits] r665 - / branches/redfit/man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Aug 21 19:49:32 CEST 2013


Author: andybunn
Date: 2013-08-21 19:49:32 +0200 (Wed, 21 Aug 2013)
New Revision: 665

Modified:
   /
   branches/redfit/man/redfit.Rd
Log:
Testing redfit and messing about with the examples in the Rd file.


Property changes on: 
___________________________________________________________________
Added: svn:ignore
   + .Rproj.user
.Rhistory
.RData


Modified: branches/redfit/man/redfit.Rd
===================================================================
--- branches/redfit/man/redfit.Rd	2013-08-19 11:30:02 UTC (rev 664)
+++ branches/redfit/man/redfit.Rd	2013-08-21 17:49:32 UTC (rev 665)
@@ -208,6 +208,25 @@
   \code{\link{print.redfit}}
 }
 \examples{data(ca533)
+# I'd like the first example to be a simple run with an ar1 dataset
+# will fuss around with this some. I think a dedicated plot function
+nyrs <- 100
+phi <- 0.7
+sigma <- 0.3
+sigma0 <-(1 - phi^2)*sigma^2
+sigma0 <- sqrt(sigma0)
+x.ar <- arima.sim(list(ar=phi),n = nyrs, sd = sigma0)+1
+x.ar[x.ar<=0] <- 0.001
+
+redf <- redfit(x.ar, nsim=1000)
+plot(redf[["freq"]], redf[["gxxc"]],
+  ylim=range(redf[["ci99"]],redf[["gxxc"]]),
+  type='n')
+grid()
+lines(redf[["freq"]], redf[["gxxc"]])
+lines(redf[["freq"]], redf[["ci99"]],col='red')
+
+# second example with tree-ring data
 t <- as.numeric(row.names(ca533))
 x <- ca533[[2]]
 idx <- which(!is.na(x))



More information about the Dplr-commits mailing list