[r-cran-zelig] 22/102: Import Upstream version 2.5-4

Andreas Tille tille at debian.org
Sun Jan 8 16:58:10 UTC 2017


This is an automated email from the git hooks/post-receive script.

tille pushed a commit to branch master
in repository r-cran-zelig.

commit 173d7096469b50611dc3a6c12727250dbf4f8628
Author: Andreas Tille <tille at debian.org>
Date:   Sun Jan 8 09:39:03 2017 +0100

    Import Upstream version 2.5-4
---
 DESCRIPTION                 |  9 +++++----
 R/model.frame.multiple.R    | 21 +++++++++++----------
 R/model.matrix.multiple.R   |  5 +++--
 R/multipleUtil.R            | 24 +++++++++++++-----------
 README                      |  3 +++
 man/current.packages.Rd     |  3 ++-
 man/model.frame.multiple.Rd |  9 ++++++---
 7 files changed, 43 insertions(+), 31 deletions(-)

diff --git a/DESCRIPTION b/DESCRIPTION
index 15e71e2..a58124b 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,13 +1,14 @@
 Package: Zelig
-Version: 2.5-3
-Date: 2006-03-09
+Version: 2.5-4
+Date: 2006-03-16
 Title: Zelig: Everyone's Statistical Software
 Author: Kosuke Imai <kimai at Princeton.Edu>,
         Gary King <king at harvard.edu>,
         Olivia Lau <olau at fas.harvard.edu>
 Maintainer: Olivia Lau <olau at fas.harvard.edu>
 Depends: R (>= 2.0.0), MASS, boot
-Suggests: VGAM (>= 0.6-7), mvtnorm, survival, sandwich (>= 1.1-0), zoo (>= 1.0-4), MCMCpack, coda
+Suggests: VGAM (>= 0.6-7), mvtnorm, survival, sandwich (>= 1.1-0), 
+          zoo (>= 1.0-4), MCMCpack, coda
 Description: Zelig is an easy-to-use program that can estimate, and
         help interpret the results of, an enormous range of
         statistical models. It literally is ``everyone's statistical
@@ -23,4 +24,4 @@ Description: Zelig is an easy-to-use program that can estimate, and
         translates them into quantities of direct interest.
 License: GPL version 2 or newer
 URL: http://gking.harvard.edu/zelig
-Packaged: Fri Mar 10 09:45:44 2006; olau
+Packaged: Thu Mar 16 14:40:47 2006; olau
diff --git a/R/model.frame.multiple.R b/R/model.frame.multiple.R
index d83a8b3..07d0b04 100644
--- a/R/model.frame.multiple.R
+++ b/R/model.frame.multiple.R
@@ -1,4 +1,4 @@
-model.frame.multiple <- function (formula,data,...){
+model.frame.multiple <- function (formula,data,eqn=NULL,...){
   if(class(formula)[[1]]=="terms"){
     terms <-formula
   }else{
@@ -7,26 +7,27 @@ model.frame.multiple <- function (formula,data,...){
 
   #is multilevel?
   if(!(is.logical(attr(terms,"subs"))))
-    return (multilevel(terms,data,mode=2))
+    return(multilevel(tt=terms,data=data,eqn=eqn,mode=2))
+
 
   "%w/o%" <- function(x,y) x[!x %in% y]
 
 
-  eqn<-names(formula)
-  eqn<-attr(terms,"systEqns")
-  nrEquations<-length(eqn)
+  eqns<-names(formula)
+  eqns<-attr(terms,"systEqns")
+  nrEquations<-length(eqns)
   termlabels<-attr(terms,"term.labels")
   depVars<-attr(terms,"depVars")
   Xs<-Ys<-tlNew<-dvNew<-list()
   for (i in 1:nrEquations){
-    rhs<-toBuildFormula(termlabels[[eqn[[i]]]])
+    rhs<-toBuildFormula(termlabels[[eqns[[i]]]])
     if(!(is.null(rhs))){
       rhs<-paste(rhs,"-1")
       rhs<-as.formula(paste("~",rhs))
-     Xs[[eqn[[i]]]]<-model.matrix.default(rhs,data=data)
-      tlNew[[eqn[[i]]]]<-colnames(Xs[[eqn[[i]]]])
-      tlNew[[eqn[[i]]]]<-gsub("as.factor\\(.*\\)","",tlNew[[eqn[[i]]]],extended=TRUE)
-      colnames(Xs[[eqn[[i]]]])<-tlNew[[eqn[[i]]]]
+     Xs[[eqns[[i]]]]<-model.matrix.default(rhs,data=data)
+      tlNew[[eqns[[i]]]]<-colnames(Xs[[eqns[[i]]]])
+      tlNew[[eqns[[i]]]]<-gsub("as.factor\\(.*\\)","",tlNew[[eqns[[i]]]],extended=TRUE)
+      colnames(Xs[[eqns[[i]]]])<-tlNew[[eqns[[i]]]]
     }
   }
   depFactors<-attr(terms,"depFactors")
diff --git a/R/model.matrix.multiple.R b/R/model.matrix.multiple.R
index ea1a341..7be9df8 100644
--- a/R/model.matrix.multiple.R
+++ b/R/model.matrix.multiple.R
@@ -9,14 +9,15 @@ model.matrix.multiple <- function (object,data,shape="compact",eqn=NULL,...){
     terms<-terms(object)
   }
   if(!(is.logical(attr(terms,"subs"))))
-    return (multilevel(terms,data,mode=1))
+    return(multilevel(tt=terms,data=data,eqn=eqn,mode=1))
+      
   ##
 
   if((shape != "compact") && (shape != "array") && (shape !="stacked"))
     stop("wrong shape argument! Choose from \"compact\", \"array\" or \"stacked\" \n")
   
   if(!(any(class(object)=="multiple")))
-    stop("Please run first parse.formula() on you formula ...\n")
+    stop("Please run first parse.formula() on your formula ...\n")
   
   if(!(any(class(data)=="multiple")))
     data<-model.frame(object,data)
diff --git a/R/multipleUtil.R b/R/multipleUtil.R
index 40a5b78..0535b23 100644
--- a/R/multipleUtil.R
+++ b/R/multipleUtil.R
@@ -17,35 +17,37 @@
 
 #mode=1 model.matrix
 #mode=2 model.frame
-multilevel<-function(tt,data,mode,...){
+multilevel<-function(tt,data,mode,eqn,...){
   if(!(mode %in% c(1,2)))
     stop("Wrong mode argument")
+  if(is.null(eqn))
+    stop("Please provide an equations")
 res<-list()
-  eqn<-attr(tt,"systEqns")
+  eqns<-attr(tt,"systEqns")
   subs<-attr(tt,"subs")
 depVars<-attr(tt,"depVars")
 
-  nrEquations<-length(eqn)
+  nrEquations<-length(eqns)
   termlabels<-attr(tt,"term.labels")
-for(i in 1:nrEquations){
-  rhs<-toBuildFormula(termlabels[[eqn[[i]]]],"+")
+#for(i in 1:nrEquations){
+  rhs<-toBuildFormula(termlabels[[eqn]],"+")
   if(!is.null(rhs))
     rhs<-paste("~",rhs)
   else
     rhs<-"~1"
-  Ynamei<-depVars[[eqn[[i]]]]
+  Ynamei<-depVars[[eqn]]
   if(!(Ynamei %in% colnames(subs)))
     lhs<-Ynamei
   else
     lhs<-NULL
   f<-as.formula(paste(lhs,rhs))
   if(mode==1)
-    res[[eqn[[i]]]]<-model.matrix.default(f,data[[eqn[[i]]]])
-  #    res[[eqn[[i]]]]<-f
+    res<-model.matrix.default(f,data)
+  #    res[[eqns[[i]]]]<-f
   else
-    res[[eqn[[i]]]]<-model.frame.default(f,data[[eqn[[i]]]])
- # res[[eqn[[i]]]]<-f
-}
+    res<-model.frame.default(f,data)
+ # res[[eqns[[i]]]]<-f
+#}
 attr(res,"terms")<-tt
 return(res)
 }
diff --git a/README b/README
index a9683bd..70da25f 100644
--- a/README
+++ b/README
@@ -1,3 +1,6 @@
+2.5-4 (March 16, 2006): Stable release for R 2.0.0-2.2.1.  Fixed bug related to 
+  windows build.  First-level dependencies are the same as in version 2.5-1.  
+
 2.5-3 (March 9, 2006): Stable release for R 2.0.0-2.2.1.  Fixed bugs related to VDC 
   GUI.  First level dependencies are the same as in version 2.5-1.
 
diff --git a/man/current.packages.Rd b/man/current.packages.Rd
index d8a65a3..db55e3a 100644
--- a/man/current.packages.Rd
+++ b/man/current.packages.Rd
@@ -30,7 +30,8 @@ suggested or required by \code{package}.
 }
 
 \examples{
+\dontrun{
 current.packages("Zelig")
-}
+}}
 
 \keyword{file}
diff --git a/man/model.frame.multiple.Rd b/man/model.frame.multiple.Rd
index 9075a43..f94e75f 100644
--- a/man/model.frame.multiple.Rd
+++ b/man/model.frame.multiple.Rd
@@ -7,14 +7,17 @@ data frame of the unique variables identified in the formula (or list
 of formulas).}
   
 \usage{
-model.frame.multiple(formula, data, ...)
+model.frame.multiple(formula, data, eqn = NULL, ...)
 }
 
 \arguments{
 \item{formula}{a list of formulas of class \code{"multiple"}, returned from \code{\link{parse.par}}}  
 \item{data}{a data frame containing all the variables used in \code{formula}}  
-\item{\dots}{additional arguments passed to \code{\link{model.frame.default}}}
-}  
+\item{eqn}{an optional character string or vector of character strings specifying 
+the equations (specified in \code{describe.mymodel}) for which you would like to 
+pull out the relevant variables.}
+\item{\dots}{additional arguments passed to 
+\code{\link{model.frame.default}}} }  
 
 \value{
 The output is a data frame (with a terms attribute) containing all the

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/r-cran-zelig.git



More information about the debian-science-commits mailing list