[Vegan-commits] r857 - in branches/1.15: R inst man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Jun 9 09:50:12 CEST 2009


Author: jarioksa
Date: 2009-06-09 09:50:12 +0200 (Tue, 09 Jun 2009)
New Revision: 857

Removed:
   branches/1.15/R/simulate.rda.R
   branches/1.15/man/simulate.rda.Rd
Modified:
   branches/1.15/inst/ChangeLog
Log:
removed simulate.rda from branches/1.15

Deleted: branches/1.15/R/simulate.rda.R
===================================================================
--- branches/1.15/R/simulate.rda.R	2009-06-08 19:39:07 UTC (rev 856)
+++ branches/1.15/R/simulate.rda.R	2009-06-09 07:50:12 UTC (rev 857)
@@ -1,40 +0,0 @@
-`simulate.rda` <-
-    function(object, nsim = 1, seed = NULL, ...) 
-{
-    ## First check cases that won't work (yet?)
-    if (!is.null(object$pCCA))
-        stop("not yet implemented for partial models")
-    ## Handle RNG: code directly from stats::simulate.lm
-    if (!exists(".Random.seed", envir = .GlobalEnv, inherits = FALSE)) 
-        runif(1)
-    if (is.null(seed)) 
-        RNGstate <- get(".Random.seed", envir = .GlobalEnv)
-    else {
-        R.seed <- get(".Random.seed", envir = .GlobalEnv)
-        set.seed(seed)
-        RNGstate <- structure(seed, kind = as.list(RNGkind()))
-        on.exit(assign(".Random.seed", R.seed, envir = .GlobalEnv))
-    }
-    ## Proper simulation: very similar for simulate.lm, but produces a
-    ## response matrix.
-    if (nsim > 1)
-        .NotYetUsed("nsim")
-    ftd <- fitted(object)
-    ans <- as.data.frame(ftd + matrix(rnorm(length(ftd), 
-        sd = outer(rep(1,nrow(ftd)), sd(object$CA$Xbar))), 
-        nrow = nrow(ftd)))
-    attr(ans, "seed") <- RNGstate
-    ans
-}
-
-`simulate.cca` <-
-    function(object, nsim = 1, seed = NULL, ...)
-{
-    .NotYetImplemented()
-}
-
-`simulate.capscale` <-
-    function(object, nsim = 1, seed = NULL, ...)
-{
-    .NotYetImplemented()
-}

Modified: branches/1.15/inst/ChangeLog
===================================================================
--- branches/1.15/inst/ChangeLog	2009-06-08 19:39:07 UTC (rev 856)
+++ branches/1.15/inst/ChangeLog	2009-06-09 07:50:12 UTC (rev 857)
@@ -11,8 +11,6 @@
 	* merged r845: summary.cca uses eigenvals.
 	
 	* copied eigenvals at r845.
-	
-	* copied simulate.rda at r814.
 
 	* merged r818, 820: tsallis got argument hill.
 

Deleted: branches/1.15/man/simulate.rda.Rd
===================================================================
--- branches/1.15/man/simulate.rda.Rd	2009-06-08 19:39:07 UTC (rev 856)
+++ branches/1.15/man/simulate.rda.Rd	2009-06-09 07:50:12 UTC (rev 857)
@@ -1,60 +0,0 @@
-\name{simulate.rda}
-\alias{simulate.rda}
-\alias{simulate.cca}
-\alias{simulate.capscale}
-\title{ Simulate Responses with Gaussian Error for Redundancy Analysis }
-
-\description{ Function simulates a response data frame so that it adds
- Gaussian error to the fitted responses of Redundancy Analysis
- (\code{\link{rda}}). The function is a special case of generic
- \code{\link{simulate}}, and works similarly as \code{simulate.lm}. 
-}
-
-\usage{
-\method{simulate}{rda}(object, nsim = 1, seed = NULL, ...)
-}
-\arguments{
-  \item{object}{an object representing a fitted \code{\link{rda}} model.}
-  \item{nsim}{number of response vectors to simulate. (Not yet used, and 
-    values above 1 will give an error). }
-  \item{seed}{an object specifying if and how the random number
-    generator should be initialized (\sQuote{seeded}). See 
-    \code{\link{simulate}} for details. }
-  \item{\dots}{additional optional arguments (ignored). }
-}
-
-\details{ The implementation follows \code{"lm"} method of
-  \code{\link{simulate}}, and adds Gaussian (Normal) error to the
-  fitted values (\code{\link{fitted.rda}} using function
-  \code{\link{rnorm}}. The standard deviations are estimated
-  independently for each species (column) from the residuals after
-  fitting the constraints.
-}
-
-\value{ Returns a data frame with similar additional arguments on
-  random number seed as \code{\link{simulate}}.  }
-
-\author{Jari Oksanen}
-
-\note{ The function is not implemented for \code{\link{cca}} or
-  \code{\link{capscale}} objects, but only for \code{\link{rda}}.  
-}
-
-\seealso{ \code{\link{simulate}} for the generic case and for
-  \code{\link{lm}} objects. Function \code{\link{fitted.rda}} returns
-  fitted values without the error component. 
-}
-
-\examples{
-data(dune)
-data(dune.env)
-mod <- rda(dune ~  Moisture + Management, dune.env)
-## One simulation
-update(mod, simulate(mod) ~  .)
-## An impression of confidence regions of site scores
-plot(mod, display="sites")
-for (i in 1:5) lines(procrustes(mod, update(mod, simulate(mod) ~ .)), col="blue")
-}
-\keyword{ models }
-\keyword{ datagen }
-\keyword{ multivariate }



More information about the Vegan-commits mailing list