[Distr-commits] r172 - branches/distr-2.0/pkg/distr/man branches/distr-2.0/pkg/distrSim/man pkg/distr pkg/distr/R pkg/distr/man pkg/distrEx pkg/distrMod/R pkg/distrSim pkg/distrSim/R pkg/distrSim/man pkg/distrTEst pkg/distrTeach
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Jun 5 17:56:36 CEST 2008
Author: stamats
Date: 2008-06-05 17:56:36 +0200 (Thu, 05 Jun 2008)
New Revision: 172
Added:
pkg/distr/R/0pre270.R
pkg/distr/man/Integer-class.Rd
Removed:
pkg/distr/R/0pre270.R
pkg/distr/man/Integer-class.Rd
Modified:
branches/distr-2.0/pkg/distr/man/internals.Rd
branches/distr-2.0/pkg/distrSim/man/subsetting-methods.Rd
pkg/distr/DESCRIPTION
pkg/distr/NAMESPACE
pkg/distr/R/plot-methods.R
pkg/distr/R/plot-methods_LebDec.R
pkg/distr/man/internals.Rd
pkg/distrEx/DESCRIPTION
pkg/distrMod/R/AllPlot.R
pkg/distrSim/DESCRIPTION
pkg/distrSim/NAMESPACE
pkg/distrSim/R/AllClasses.R
pkg/distrSim/R/SeqDataFrames-Class.R
pkg/distrSim/R/subsetting-methods.R
pkg/distrSim/man/subsetting-methods.Rd
pkg/distrTEst/DESCRIPTION
pkg/distrTeach/NAMESPACE
Log:
merged branch into trunk ...
I hope that worked as expected!
Modified: branches/distr-2.0/pkg/distr/man/internals.Rd
===================================================================
--- branches/distr-2.0/pkg/distr/man/internals.Rd 2008-06-03 12:13:00 UTC (rev 171)
+++ branches/distr-2.0/pkg/distr/man/internals.Rd 2008-06-05 15:56:36 UTC (rev 172)
@@ -2,6 +2,7 @@
\alias{internals_for_distr}
\alias{.is.vector.lattice}
\alias{.is.consistent}
+\alias{.isInteger}
\alias{.isNatural}
\alias{.isNatural0}
\alias{.mergegaps}
Modified: branches/distr-2.0/pkg/distrSim/man/subsetting-methods.Rd
===================================================================
--- branches/distr-2.0/pkg/distrSim/man/subsetting-methods.Rd 2008-06-03 12:13:00 UTC (rev 171)
+++ branches/distr-2.0/pkg/distrSim/man/subsetting-methods.Rd 2008-06-05 15:56:36 UTC (rev 172)
@@ -19,7 +19,7 @@
\item{j}{ observation dimension index; may be missing}
\item{k}{ run index; may be missing}
\item{drop}{ as in the general indexing functions}
- \item{value}{ modication to be assigned to}
+ \item{value}{ modification to be assigned to}
}
\section{Methods}{
\describe{
Modified: pkg/distr/DESCRIPTION
===================================================================
--- pkg/distr/DESCRIPTION 2008-06-03 12:13:00 UTC (rev 171)
+++ pkg/distr/DESCRIPTION 2008-06-05 15:56:36 UTC (rev 172)
@@ -1,6 +1,6 @@
Package: distr
Version: 2.0
-Date: 2008-05-08
+Date: 2008-05-30
Title: Object orientated implementation of distributions
Description: Object orientated implementation of distributions
Author: Florian Camphausen, Matthias Kohl, Peter Ruckdeschel, Thomas Stabla
Modified: pkg/distr/NAMESPACE
===================================================================
--- pkg/distr/NAMESPACE 2008-06-03 12:13:00 UTC (rev 171)
+++ pkg/distr/NAMESPACE 2008-06-05 15:56:36 UTC (rev 172)
@@ -13,7 +13,7 @@
"Lattice", "DiscreteDistribution",
"LatticeDistribution", "EuclideanSpace", "Reals",
"Naturals", "standardMethods",
- "distrARITH", "distrMASK", "getLabel")
+ "distrARITH", "distrMASK", "getLabel", "devNew")
export("AbscontDistribution")
export("DistrList", "UnivarDistrList")
exportClasses("rSpace", "EuclideanSpace", "Reals",
Deleted: pkg/distr/R/0pre270.R
===================================================================
--- pkg/distr/R/0pre270.R 2008-06-03 12:13:00 UTC (rev 171)
+++ pkg/distr/R/0pre270.R 2008-06-05 15:56:36 UTC (rev 172)
@@ -1,11 +0,0 @@
-### for working under R < 2.8.0
-if(getRversion()<'2.8.0'){
- devNew <- function(...){
- get(getOption("device"))(...)
- }
-}else{
- devNew <- function(...){
- dev.new(...)
- }
-}
-
Copied: pkg/distr/R/0pre270.R (from rev 171, pkg/distr/R/0pre270.R)
===================================================================
--- pkg/distr/R/0pre270.R (rev 0)
+++ pkg/distr/R/0pre270.R 2008-06-05 15:56:36 UTC (rev 172)
@@ -0,0 +1,11 @@
+### for working under R < 2.8.0
+if(getRversion()<'2.8.0'){
+ devNew <- function(...){
+ get(getOption("device"))(...)
+ }
+}else{
+ devNew <- function(...){
+ dev.new(...)
+ }
+}
+
Modified: pkg/distr/R/plot-methods.R
===================================================================
--- pkg/distr/R/plot-methods.R 2008-06-03 12:13:00 UTC (rev 171)
+++ pkg/distr/R/plot-methods.R 2008-06-05 15:56:36 UTC (rev 172)
@@ -48,7 +48,7 @@
col.sub <- dots$col
if (!withSweave)
- get(getOption("device"))(width = width, height = height)
+ devNew(width = width, height = height)
omar <- par("mar")
mainL <- FALSE
@@ -306,7 +306,7 @@
col.sub <- dots$col
if (!withSweave)
- get(getOption("device"))(width = width, height = height)
+ devNew(width = width, height = height)
omar <- par("mar")
mainL <- FALSE
@@ -524,9 +524,9 @@
# -------- DistributionList ---------- #
setMethod("plot", "DistrList",
- function(x,y=NULL,...){
+ function(x, y = NULL, ...){
for(i in 1:length(x)){
- get(getOption("device"))()
+ devNew()
plot(x[[i]],...)
}
})
Modified: pkg/distr/R/plot-methods_LebDec.R
===================================================================
--- pkg/distr/R/plot-methods_LebDec.R 2008-06-03 12:13:00 UTC (rev 171)
+++ pkg/distr/R/plot-methods_LebDec.R 2008-06-05 15:56:36 UTC (rev 172)
@@ -92,7 +92,7 @@
col.sub <- dots$col
if (!withSweave)
- get(getOption("device"))(width = width, height = height)
+ devNew(width = width, height = height)
omar <- par("mar")
mainL <- FALSE
Deleted: pkg/distr/man/Integer-class.Rd
===================================================================
--- pkg/distr/man/Integer-class.Rd 2008-06-03 12:13:00 UTC (rev 171)
+++ pkg/distr/man/Integer-class.Rd 2008-06-05 15:56:36 UTC (rev 172)
@@ -1,39 +0,0 @@
-\name{Integer-class}
-\docType{class}
-\alias{Integer-class}
-\alias{coerce,numeric,Integer-method}
-
-\title{Internal Class "Integer"}
-\description{For the ease of method dispatch, there is an internal
-S4 class \code{Integer}, which is a subclass of \code{numeric} and has a
-straightforward validity method.}
-\section{Objects from the Class}{
-new("Integer",
-}
-\section{Slots}{
-\describe{
- \item{\code{.Data}:}{Object of class \code{"numeric"}}
- }
-}
-\section{Extends}{
-Class \code{"\linkS4class{numeric}"}, from data part.
-Class \code{"\linkS4class{vector}"}, by class "numeric", distance 2.
-}
-\section{Methods}{
- \item{coerce}{\code{signature(from = "numeric", to = "Integer")}:
- create a \code{"Integer"} object from a \code{"numeric"} vector.}
-}
-%\references{ ~put references to the literature/web site here ~ }
-\author{
- Peter Ruckdeschel \email{Peter.Ruckdeschel at itwm.fraunhofer.de}
-}
-%\note{ ~~further notes~~ }
-\seealso{
-\code{\link{numeric}}, \code{\link{vector}}
-}
-%\examples{}
-\keyword{classes}
-\keyword{internal}
-
-
-
Copied: pkg/distr/man/Integer-class.Rd (from rev 171, branches/distr-2.0/pkg/distr/man/Integer-class.Rd)
===================================================================
--- pkg/distr/man/Integer-class.Rd (rev 0)
+++ pkg/distr/man/Integer-class.Rd 2008-06-05 15:56:36 UTC (rev 172)
@@ -0,0 +1,39 @@
+\name{Integer-class}
+\docType{class}
+\alias{Integer-class}
+\alias{coerce,numeric,Integer-method}
+
+\title{Internal Class "Integer"}
+\description{For the ease of method dispatch, there is an internal
+S4 class \code{Integer}, which is a subclass of \code{numeric} and has a
+straightforward validity method.}
+\section{Objects from the Class}{
+new("Integer",
+}
+\section{Slots}{
+\describe{
+ \item{\code{.Data}:}{Object of class \code{"numeric"}}
+ }
+}
+\section{Extends}{
+Class \code{"\linkS4class{numeric}"}, from data part.
+Class \code{"\linkS4class{vector}"}, by class "numeric", distance 2.
+}
+\section{Methods}{
+ \item{coerce}{\code{signature(from = "numeric", to = "Integer")}:
+ create a \code{"Integer"} object from a \code{"numeric"} vector.}
+}
+%\references{ ~put references to the literature/web site here ~ }
+\author{
+ Peter Ruckdeschel \email{Peter.Ruckdeschel at itwm.fraunhofer.de}
+}
+%\note{ ~~further notes~~ }
+\seealso{
+\code{\link{numeric}}, \code{\link{vector}}
+}
+%\examples{}
+\keyword{classes}
+\keyword{internal}
+
+
+
Modified: pkg/distr/man/internals.Rd
===================================================================
--- pkg/distr/man/internals.Rd 2008-06-03 12:13:00 UTC (rev 171)
+++ pkg/distr/man/internals.Rd 2008-06-05 15:56:36 UTC (rev 172)
@@ -2,7 +2,7 @@
\alias{internals_for_distr}
\alias{.is.vector.lattice}
\alias{.is.consistent}
-\alias{.isInteger}
+\alias{.isInteger}
\alias{.isNatural}
\alias{.isNatural0}
\alias{.mergegaps}
@@ -47,7 +47,7 @@
\alias{.Q2P}
\alias{.csimpsum}
\alias{.primefun}
-\alias{coerce,numeric,Integer-method}
+\alias{devNew}
\title{Internal functions of package distr}
@@ -78,7 +78,7 @@
.multm(e1, e2, Dclass = "DiscreteDistribution")
.notwithLArg(D)
.getObjName(i = 1)
-.discretizeP(D, lower, upper, h)
+.discretizeP(D, lower, upper, h)
.fm(x,f)
.fM(x,f)
.fM2(x,f)
@@ -108,6 +108,7 @@
.Q2P (q, ngrid = getdistrOption("DefaultNrGridPoints"))
.csimpsum(fx)
.primefun(f,x, nm = NULL)
+devNew(...)
}
@@ -195,6 +196,7 @@
\item{fx}{a vector of function evaluations multiplied by the gridwidth}
\item{f}{a vector of function evaluations}
\item{nm}{an optional right asymptotic value}
+ \item{...}{arguments passed through to other functions}
}
\details{
@@ -298,7 +300,7 @@
\code{.D2P} and \code{.Q2P} reconstruct function slot \code{p} from
from function slots \code{d} resp. \code{q}
by means of function \code{.makePNew} and explicite numeric inversion,
-respectively.
+respectively.
\code{.csimpsum} is used internally in \code{.makePNew} to produce
a prime function out of function evaluations by means of vectorized
@@ -307,6 +309,8 @@
of \code{cumsum}. \code{.primefun} is similar but more flexible and
produces the prime function as a function.
+\code{devNew} opens a new device. This function is for back compatibility
+with R versions < 2.8.0.
}
@@ -358,11 +362,13 @@
lower.tail = TRUE, log.p = FALSE)}}
\code{.csimpsum}{a vector of evaluations of the prime function at the grid points}
\code{.primefun}{the prime function as a function}
+\code{devNew}{returns the return value of the device opened, usually invisible 'NULL'}
}
\author{
Peter Ruckdeschel \email{Peter.Ruckdeschel at itwm.fraunhofer.de}
- }
+ Matthias Kohl \email{Matthias.Kohl at stamats.de}
+}
\seealso{
\code{\link{AbscontDistribution}},
@@ -373,7 +379,7 @@
\code{\link{convpow}},
\code{\link{operators}},
\code{\link{plot-methods}}
+\code{\link[grDevices]{dev.new}}
}
-
\keyword{internal}
\concept{utilities}
Modified: pkg/distrEx/DESCRIPTION
===================================================================
--- pkg/distrEx/DESCRIPTION 2008-06-03 12:13:00 UTC (rev 171)
+++ pkg/distrEx/DESCRIPTION 2008-06-05 15:56:36 UTC (rev 172)
@@ -1,6 +1,6 @@
Package: distrEx
Version: 2.0
-Date: 2008-05-08
+Date: 2008-05-30
Title: Extensions of package distr
Description: Extensions of package distr and some additional functionality
Depends: R(>= 2.6.0), methods, distr(>= 2.0), evd, startupmsg
@@ -9,5 +9,4 @@
Maintainer: Matthias Kohl <Matthias.Kohl at stamats.de>
LazyLoad: yes
License: GPL (version 2 or later)
-URL: http://distr.r-forge.r-project.org/
-Packaged: Fri Jun 8 00:12:57 2007; Peter
+URL: http://distr.r-forge.r-project.org/
\ No newline at end of file
Modified: pkg/distrMod/R/AllPlot.R
===================================================================
--- pkg/distrMod/R/AllPlot.R 2008-06-03 12:13:00 UTC (rev 171)
+++ pkg/distrMod/R/AllPlot.R 2008-06-05 15:56:36 UTC (rev 172)
@@ -39,7 +39,7 @@
w0 <- options("warn")
options(warn = -1)
opar <- par()
- get(getOption("device"))()
+ devNew()
nrows <- trunc(sqrt(dims))
ncols <- ceiling(dims/nrows)
par(mfrow = c(nrows, ncols))
Modified: pkg/distrSim/DESCRIPTION
===================================================================
--- pkg/distrSim/DESCRIPTION 2008-06-03 12:13:00 UTC (rev 171)
+++ pkg/distrSim/DESCRIPTION 2008-06-05 15:56:36 UTC (rev 172)
@@ -1,6 +1,6 @@
Package: distrSim
Version: 2.0
-Date: 2008-05-08
+Date: 2008-06-03
Title: Simulation classes based on package distr
Depends: R(>= 2.6.0), methods, graphics, setRNG(>= 2006.2-1), distr(>= 2.0), startupmsg
Suggests: distrEx(>= 2.0)
Modified: pkg/distrSim/NAMESPACE
===================================================================
--- pkg/distrSim/NAMESPACE 2008-06-03 12:13:00 UTC (rev 171)
+++ pkg/distrSim/NAMESPACE 2008-06-05 15:56:36 UTC (rev 172)
@@ -5,7 +5,7 @@
import("startupmsg")
export("cload", "Dataclass", "Simulation", "Contsimulation",
- "distrSimoptions", "getdistrSimOption", "seqDataFrames", "distrSimMASK")
+ "distrSimoptions", "getdistrSimOption", "SeqDataFrames", "distrSimMASK")
exportClasses("vectororNULL", "Dataclass", "Simulation", "Contsimulation",
"SeqDataFrames", "MatrixorNULLorVector","ArrayorNULLorVector",
"ArrayorNULLorVectororDataframeorSeqDataFrames","DataframeorSeqDataFrames")
Modified: pkg/distrSim/R/AllClasses.R
===================================================================
--- pkg/distrSim/R/AllClasses.R 2008-06-03 12:13:00 UTC (rev 171)
+++ pkg/distrSim/R/AllClasses.R 2008-06-05 15:56:36 UTC (rev 172)
@@ -8,11 +8,11 @@
validity = function(object){
len <- length(object at data)
if (len > 1)
- { if (!all(lapply(object at data, is.data.frame)))
+ { if (!all(unlist(lapply(object at data, is.data.frame))))
stop("all elements must be data frames")
f <- function(y) {list(ncol(y), names(y))}
g <- function(y) identical(f(y), f(object at data[[1]]))
- if (!all(lapply(object at data, g)))
+ if (!all(unlist(lapply(object at data, g))))
stop("all elements must have the same column structure")
}
return(TRUE) }
Modified: pkg/distrSim/R/SeqDataFrames-Class.R
===================================================================
--- pkg/distrSim/R/SeqDataFrames-Class.R 2008-06-03 12:13:00 UTC (rev 171)
+++ pkg/distrSim/R/SeqDataFrames-Class.R 2008-06-05 15:56:36 UTC (rev 172)
@@ -1,4 +1,4 @@
-seqDataFrames <- function(...) new("SeqDataFrames", data=list(...))
+SeqDataFrames <- function(...) new("SeqDataFrames", data=list(...))
## Access methods
Modified: pkg/distrSim/R/subsetting-methods.R
===================================================================
--- pkg/distrSim/R/subsetting-methods.R 2008-06-03 12:13:00 UTC (rev 171)
+++ pkg/distrSim/R/subsetting-methods.R 2008-06-05 15:56:36 UTC (rev 172)
@@ -1,6 +1,6 @@
setMethod("[", signature(x = "SeqDataFrames"),
function(x, i, j, k, ..., drop = FALSE){
- if(missing(k)) k <- 1:length(x at data)
+ if(missing(k)) k <- seq_len(length(x at data))
kl <- length(k)
if (kl == 1){
daf <- "["(x at data[[k]],i,j, drop = drop)
@@ -8,13 +8,13 @@
return(daf)
else return(new("SeqDataFrames", data = list(daf)))
}else {
- kn <- 1:length(x at data)
+ kn <- seq_len(length(x at data))
if(!is.null(names(x at data)))
names(kn) <- names(x at data)
kl0 <- kn[k]
kll <- length(kl0)
lis <- vector("list",kll)
- for (kk in 1:kll)
+ for (kk in seq_len(kll))
{lis[[kk]] <- as.data.frame("["(x at data[[kl0[kk]]], i,j, drop = drop))
if(!is.null(names(x at data)))
names(lis)[kk] <- names(x at data)[kl0[kk]]}
@@ -23,13 +23,13 @@
setReplaceMethod("[", signature(x = "SeqDataFrames"),
function(x, i, j, k, ..., value){
- if(missing(k)) k <- 1:length(x at data)
+ if(missing(k)) k <- seq_len(length(x at data))
if(length(k)==1){
if((k<=length(x at data))||!is(try(x at data[[k]],silent=TRUE),"try-error"))
{zl <- x at data
z <- zl[[k]]
if (missing(i))
- { i <- 1:nrow(z)
+ { i <- seq_len(nrow(z))
#if(!is.null(dim(value)))
# z <- data.frame(matrix(NA,nrow(value),ncol(x at data[[1]])))
# else z <- data.frame(matrix(NA,length(value),ncol(x at data[[1]])))
@@ -46,21 +46,24 @@
}
return(x)}
- if(missing(j)) j <- 1:ncol(x at data[[1]])
- if(missing(i)) i <- lapply(1:length(x at data),function(y) 1:nrow(x at data[[y]]))
+ if(missing(j)) j <- seq_len(ncol(x at data[[1]]))
+ if(missing(i)) i <- lapply(seq_len(length(x at data)),function(y) seq_len(nrow(x at data[[y]])))
if(is(value, "SeqDataFrames")) value <- value at data
- kn <- 1: length(x at data)
+ kn <- seq_len(length(x at data))
if(!is.null(names(x at data)))
names(kn) <- names(x at data)
kl0 <- kn[k]
kll <- length(kl0)
- if(!is.list(i)) i <- lapply(kl0,function(y) i)
+## Is the following line correct?
+## should it be: if(!is.list(i)) i <- lapply(kl0, function(y) y)
+## or: if(!is.list(i)) i <- as.list(kl0)?
+ if(!is.list(i)) i <- lapply(kl0, function(y) i)
if(is(value,"atomic"))
- value <- lapply(1:kll,
+ value <- lapply(seq_len(kll),
function(y) data.frame(matrix(
rep(value, length( i[[kl0[y]]])*length(j)),
length(i[[kl0[y]]]),
@@ -72,7 +75,7 @@
value <- lapply(kl0,function(y) value)
zl <- x at data
- for(kk in 1:kll)
+ for(kk in seq_len(kll))
{z <- zl[[kl0[kk]]]
z[c(unlist(i[[kl0[kk]]])),j] <- value[kk]
zl[[kl0[kk]]] <- z
Modified: pkg/distrSim/man/subsetting-methods.Rd
===================================================================
--- pkg/distrSim/man/subsetting-methods.Rd 2008-06-03 12:13:00 UTC (rev 171)
+++ pkg/distrSim/man/subsetting-methods.Rd 2008-06-05 15:56:36 UTC (rev 172)
@@ -8,11 +8,9 @@
\description{Operators acting on \code{SeqDataFrames} objects to extract
or replace parts.}
\usage{
-## "["(x,i,j,k, drop = FALSE) # is: x[i,j,k, drop = FALSE]
-\S4method{"["}{SeqDataFrames}(x, i, j, k, ..., drop = FALSE)
+\S4method{[}{SeqDataFrames}(x, i, j, k, drop = FALSE)
-## "[<-"(x,i,j,k, value) # is: x[i,j,k] <- value
-\S4method{[<-}{SeqDataFrames}(x, i, j, k, ..., value)
+\S4method{[}{SeqDataFrames}(x, i, j, k) <- value
}
\arguments{
\item{x}{ object of class \code{SeqDataFrames} from which to extract element(s) or in which to
@@ -25,24 +23,23 @@
}
\section{Methods}{
\describe{
- \item{"["}{\code{signature(x = "SeqDataFrames", i = "ANY", j = "ANY", drop = "ANY")}:
+ \item{"["}{\code{signature(x = "SeqDataFrames")}:
access method for indices for objects of class \code{SeqDataFrames}}
- \item{"[<-"}{\code{signature(x = "SeqDataFrames", i = "ANY", j = "ANY", drop = "ANY"))}:
+ \item{"[<-"}{\code{signature(x = "SeqDataFrames")}:
replacement method for indices for objects of class \code{SeqDataFrames}}
}
}
\value{again an object of class \code{SeqDataFrames} with the prescribed indices / values}
\seealso{\code{\link[base]{"["}}}
-\keyword{methods}
\examples{
s0 <- matrix(1:6,3,2)
d0 <- data.frame(s0)
d1 <- data.frame(s0 + 3)
-SF <- seqDataFrames(d0, d1)
+SF <- SeqDataFrames(d0, d1)
SF[1,2,1]
-
}
+\keyword{methods}
\concept{subsetting}
\concept{indexing}
\concept{accessor function}
Modified: pkg/distrTEst/DESCRIPTION
===================================================================
--- pkg/distrTEst/DESCRIPTION 2008-06-03 12:13:00 UTC (rev 171)
+++ pkg/distrTEst/DESCRIPTION 2008-06-05 15:56:36 UTC (rev 172)
@@ -1,6 +1,6 @@
Package: distrTEst
Version: 2.0
-Date: 2008-05-08
+Date: 2008-05-30
Title: Estimation and Testing classes based on package distr
Depends: R(>= 2.6.0), methods, graphics, setRNG(>= 2006.2-1), distr(>= 2.0), distrSim(>= 2.0), startupmsg
Suggests: distrEx(>= 2.0)
Modified: pkg/distrTeach/NAMESPACE
===================================================================
--- pkg/distrTeach/NAMESPACE 2008-06-03 12:13:00 UTC (rev 171)
+++ pkg/distrTeach/NAMESPACE 2008-06-05 15:56:36 UTC (rev 172)
@@ -2,7 +2,7 @@
import("distrEx")
import("startupmsg")
-exportMethods("plot")
+exportMethods("plotCLT")
export("illustrateLLN")
export("illustrateCLT")
export("illustrateCLT.tcl")
More information about the Distr-commits
mailing list