[Rsiena-commits] r318 - in pkg: RSiena RSiena/R RSiena/man RSiena/tests RSienaTest RSienaTest/R RSienaTest/doc RSienaTest/man RSienaTest/tests
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Sun Sep 10 17:59:28 CEST 2017
Author: tomsnijders
Date: 2017-09-10 17:59:28 +0200 (Sun, 10 Sep 2017)
New Revision: 318
Modified:
pkg/RSiena/ChangeLog
pkg/RSiena/DESCRIPTION
pkg/RSiena/R/effectsMethods.r
pkg/RSiena/man/RSiena-package.Rd
pkg/RSiena/tests/parallel.R
pkg/RSiena/tests/parallel.Rout.save
pkg/RSienaTest/ChangeLog
pkg/RSienaTest/DESCRIPTION
pkg/RSienaTest/R/effectsMethods.r
pkg/RSienaTest/doc/RSiena_Manual.pdf
pkg/RSienaTest/doc/RSiena_Manual.tex
pkg/RSienaTest/man/RSiena-package.Rd
pkg/RSienaTest/man/sienaBayes.Rd
pkg/RSienaTest/tests/parallel.R
pkg/RSienaTest/tests/parallel.Rout.save
Log:
Correction of print.sienaFit, extra lines in test.
Modified: pkg/RSiena/ChangeLog
===================================================================
--- pkg/RSiena/ChangeLog 2017-09-09 11:47:09 UTC (rev 317)
+++ pkg/RSiena/ChangeLog 2017-09-10 15:59:28 UTC (rev 318)
@@ -1,14 +1,27 @@
+2017-09-09 R-Forge Revision 318, packages version 1.2-4.
+Changes in RSiena and RSienaTest:
+ * Longer Description field in DESCRIPTION, as per CRAN suggestions.
+ * Correction of print.sienaFit, repairing the option include=FALSE
+ in setEffect and includeEffects.
+ * Included test of includeEffects in parallel.r.
+Changes in RSienaTest:
+ * Extra line in example for sienaBayes.Rd.
+
+2017-09-09 R-Forge Revision 317
+Changes in RSienaTest:
+ * Effects:
+ Move 'using namespace std' to cpp files.
+ Make value() consistently 'const'.
+ Use std::abs for integers.
+ Remove unused fields.
+ * UniversalSetting.cpp: Do not hide GeneralSetting::terminateSetting().
+ * siena07models.cpp: Reduce state complexity (rchk test).
+ * siena07*.cpp: Fix unPROTECTed vars (rchk test).
+
2017-09-08 R-Forge Revision 316, cran package version 1.2-3
Changes in RSiena and RSienaTest:
* totAlt also for non-directed networks
- * siena07models.h corrected number of arguments forwardModel/model.
- * Added cran-comments.md, .Rbuildignore for comments about cran submission
- * dropped lpFirstNetwork, lpSecondNetwork, lpTwoNetworkCache from
- CovariateMixedNetworkAlterFunction.h (not used).
-Changes in RSiena:
- * siena07models.h corrected number of arguments forwardModel.
-Changes in RSienaTest:
- * siena07models.h corrected arguments model.
+ * Added cran-comments.md, .Rbuildignore for comments about cran submission.
2017-09-07 R-Forge Revision 315
Changes in RSiena:
Modified: pkg/RSiena/DESCRIPTION
===================================================================
--- pkg/RSiena/DESCRIPTION 2017-09-09 11:47:09 UTC (rev 317)
+++ pkg/RSiena/DESCRIPTION 2017-09-10 15:59:28 UTC (rev 318)
@@ -1,16 +1,19 @@
Package: RSiena
Type: Package
Title: Siena - Simulation Investigation for Empirical Network Analysis
-Version: 1.2-3
-Date: 2017-09-08
+Version: 1.2-4
+Date: 2017-09-10
Author: Ruth Ripley, Krists Boitmanis, Tom A.B. Snijders, Felix Schoenenberger
Depends: R (>= 2.15.0), utils
Imports: Matrix, tcltk, lattice, parallel, MASS, methods
Suggests: xtable, network, tools, codetools
SystemRequirements: GNU make, tcl/tk 8.5, Tktable
Maintainer: Tom A.B. Snijders <tom.snijders at nuffield.ox.ac.uk>
-Description: Statistical modelling for longitudinal network data
- using stochastic actor-oriented models.
+Description: Simulation-based estimation of stochastic actor-oriented models
+ for longitudinal network data collected as panel data. Dependent variables
+ can be single or multivariate networks, which can be directed, non-directed,
+ or two-mode. There are also functions for testing parameters and checking
+ goodness of fit.
License: GPL (>= 3)
LazyLoad: yes
LazyData: yes
Modified: pkg/RSiena/R/effectsMethods.r
===================================================================
--- pkg/RSiena/R/effectsMethods.r 2017-09-09 11:47:09 UTC (rev 317)
+++ pkg/RSiena/R/effectsMethods.r 2017-09-10 15:59:28 UTC (rev 318)
@@ -50,16 +50,22 @@
timeDummies <- !x$timeDummy[x$include] == ","
specs <- as.data.frame(x[, c("name", "effectName", "include", "fix",
"test", "initialValue", "parm")])
- specs.br <- x$basicRate
if (includeOnly)
{
- specs <- specs[x$include, ]
- row.names(specs) <- 1:nrow(specs)
+ included <- x$include
+ }
+ else
+ {
+ included <- rep(TRUE, nrow(x))
}
if (dropRates)
{
- specs.br <- specs.br[x$include]
- specs <- specs[!specs.br, ]
+ included <- included & !x$basicRate
+ }
+ specs <- specs[included, ]
+ if (nrow(specs) > 0)
+ {
+ row.names(specs) <- 1:nrow(specs)
}
if (nDependents == 1)
{
@@ -67,23 +73,23 @@
}
if (any(endowments))
{
- specs <- cbind(specs, type=x[x$include, "type"])
+ specs <- cbind(specs, type=x[included, "type"])
}
if (any(timeDummies))
{
- specs <- cbind(specs, timeDummy=x[x$include, "timeDummy"])
+ specs <- cbind(specs, timeDummy=x[included, "timeDummy"])
}
if (any(userSpecifieds))
{
- specs <- cbind(specs, x[x$include, c("effect1", "effect2")])
- if (any (x$effect3[x$include] > 0))
+ specs <- cbind(specs, x[included, c("effect1", "effect2")])
+ if (any (x$effect3[included] > 0))
{
- specs <- cbind(specs, effect3=x[x$include, "effect3"])
+ specs <- cbind(specs, effect3=x[included, "effect3"])
}
}
if (includeRandoms)
{
- specs <- cbind(specs, randomEffects=x[x$include, "randomEffects"])
+ specs <- cbind(specs, randomEffects=x[included, "randomEffects"])
}
specs[, "initialValue"] <- format(round(specs$initialValue,digits=5),
width=10)
Modified: pkg/RSiena/man/RSiena-package.Rd
===================================================================
--- pkg/RSiena/man/RSiena-package.Rd 2017-09-09 11:47:09 UTC (rev 317)
+++ pkg/RSiena/man/RSiena-package.Rd 2017-09-10 15:59:28 UTC (rev 318)
@@ -44,8 +44,8 @@
\tabular{ll}{
Package: \tab RSiena\cr
Type: \tab Package\cr
-Version: \tab 1.2-3\cr
-Date: \tab 2017-09-08\cr
+Version: \tab 1.2-4\cr
+Date: \tab 2017-09-10\cr
Depends: \tab R (>= 3.0.0)\cr
Imports: \tab Matrix\cr
Suggests: \tab tcltk, network, codetools, lattice, MASS, parallel,
Modified: pkg/RSiena/tests/parallel.R
===================================================================
--- pkg/RSiena/tests/parallel.R 2017-09-09 11:47:09 UTC (rev 317)
+++ pkg/RSiena/tests/parallel.R 2017-09-10 15:59:28 UTC (rev 318)
@@ -12,6 +12,8 @@
batch=TRUE, parallelTesting=TRUE, silent=TRUE)
#,dll='../siena/src/RSiena.dll')
ans
+(myeff <- includeEffects(myeff, transTrip, cycle4))
+(myeff <- includeEffects(myeff, cycle4, include=FALSE))
##test4
mymodel$projname <- 'test4'
mymodel$cconditional <- TRUE
Modified: pkg/RSiena/tests/parallel.Rout.save
===================================================================
--- pkg/RSiena/tests/parallel.Rout.save 2017-09-09 11:47:09 UTC (rev 317)
+++ pkg/RSiena/tests/parallel.Rout.save 2017-09-10 15:59:28 UTC (rev 318)
@@ -1,6 +1,6 @@
-R version 3.2.1 (2015-06-18) -- "World-Famous Astronaut"
-Copyright (C) 2015 The R Foundation for Statistical Computing
+R version 3.4.0 (2017-04-21) -- "You Stupid Darkness"
+Copyright (C) 2017 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
@@ -43,6 +43,26 @@
Total of 407 iteration steps.
+> (myeff <- includeEffects(myeff, transTrip, cycle4))
+ effectName include fix test initialValue parm
+1 transitive triplets TRUE FALSE FALSE 0 0
+2 4-cycles (#) TRUE FALSE FALSE 0 1
+ effectName include fix test initialValue parm
+1 basic rate parameter mynet1 TRUE FALSE FALSE 4.80941 0
+2 outdegree (density) TRUE FALSE FALSE -0.56039 0
+3 reciprocity TRUE FALSE FALSE 0.00000 0
+4 transitive triplets TRUE FALSE FALSE 0.00000 0
+5 4-cycles (#) TRUE FALSE FALSE 0.00000 1
+> (myeff <- includeEffects(myeff, cycle4, include=FALSE))
+[1] effectName include fix test initialValue
+[6] parm
+<0 rows> (or 0-length row.names)
+ effectName include fix test initialValue parm
+1 basic rate parameter mynet1 TRUE FALSE FALSE 4.80941 0
+2 outdegree (density) TRUE FALSE FALSE -0.56039 0
+3 reciprocity TRUE FALSE FALSE 0.00000 0
+4 transitive triplets TRUE FALSE FALSE 0.00000 0
+
> ##test4
> mymodel$projname <- 'test4'
> mymodel$cconditional <- TRUE
Modified: pkg/RSienaTest/ChangeLog
===================================================================
--- pkg/RSienaTest/ChangeLog 2017-09-09 11:47:09 UTC (rev 317)
+++ pkg/RSienaTest/ChangeLog 2017-09-10 15:59:28 UTC (rev 318)
@@ -1,3 +1,12 @@
+2017-09-09 R-Forge Revision 318, packages version 1.2-4.
+Changes in RSiena and RSienaTest:
+ * Longer Description field in DESCRIPTION, as per CRAN suggestions.
+ * Correction of print.sienaFit, repairing the option include=FALSE
+ in setEffect and includeEffects.
+ * Included test of includeEffects in parallel.r.
+Changes in RSienaTest:
+ * Extra line in example for sienaBayes.Rd.
+
2017-09-09 R-Forge Revision 317
Changes in RSienaTest:
* Effects:
Modified: pkg/RSienaTest/DESCRIPTION
===================================================================
--- pkg/RSienaTest/DESCRIPTION 2017-09-09 11:47:09 UTC (rev 317)
+++ pkg/RSienaTest/DESCRIPTION 2017-09-10 15:59:28 UTC (rev 318)
@@ -1,16 +1,19 @@
Package: RSienaTest
Type: Package
Title: Siena - Simulation Investigation for Empirical Network Analysis
-Version: 1.2-3
-Date: 2017-09-09
+Version: 1.2-4
+Date: 2017-09-10
Author: Ruth Ripley, Krists Boitmanis, Tom A.B. Snijders, Felix Schoenenberger
Depends: R (>= 2.15.0), utils
Imports: Matrix, tcltk, lattice, parallel, MASS, RUnit, methods
Suggests: xtable, network, tools, codetools
SystemRequirements: GNU make, tcl/tk 8.5, Tktable
Maintainer: Tom A.B. Snijders <tom.snijders at nuffield.ox.ac.uk>
-Description: Statistical modelling for longitudinal network data
- using stochastic actor-oriented models.
+Description: Simulation-based estimation of stochastic actor-oriented models
+ for longitudinal network data collected as panel data. Dependent variables
+ can be single or multivariate networks, which can be directed, non-directed,
+ or two-mode. There are also functions for testing parameters and checking
+ goodness of fit.
License: GPL (>= 3)
LazyLoad: yes
LazyData: yes
Modified: pkg/RSienaTest/R/effectsMethods.r
===================================================================
--- pkg/RSienaTest/R/effectsMethods.r 2017-09-09 11:47:09 UTC (rev 317)
+++ pkg/RSienaTest/R/effectsMethods.r 2017-09-10 15:59:28 UTC (rev 318)
@@ -11,287 +11,293 @@
## ****************************************************************************/
##@print.sienaEffects Methods
print.sienaEffects <- function(x, fileName=NULL, includeOnly=TRUE,
- expandDummies=FALSE, includeRandoms=FALSE, dropRates=FALSE, ...)
+ expandDummies=FALSE, includeRandoms=FALSE, dropRates=FALSE, ...)
{
- if (!inherits(x, "sienaEffects"))
- stop("not a legitimate Siena effects object")
+ if (!inherits(x, "sienaEffects"))
+ stop("not a legitimate Siena effects object")
- if (typeof(fileName)=="character")
- {
- sink(fileName, split=TRUE)
- }
+ if (typeof(fileName)=="character")
+ {
+ sink(fileName, split=TRUE)
+ }
- interactions <- x[x$shortName %in% c("unspInt", "behUnspInt") & x$include &
- x$effect1 > 0, ]
- if (expandDummies)
- {
- if(includeOnly && !all(x[x$include, "timeDummy"] == ",")
- || !all(x[, "timeDummy"] == "," ))
- {
- x <- sienaTimeFix(x)$effects
- x <- fixUpEffectNames(x)
- }
- else
- {
- if (nrow(interactions) > 0)
- {
- x <- fixUpEffectNames(x)
- }
- }
- }
- if (nrow(x) > 0)
- {
- nDependents <- length(unique(x$name))
- userSpecifieds <- x$shortName[x$include] %in%
- c("unspInt", "behUnspInt")
- endowments <- !x$type[x$include] %in% c("rate", "eval")
- # includes creations and gmm
- gmm <- any(x$type[x$include] %in% "gmm")
- timeDummies <- !x$timeDummy[x$include] == ","
- specs <- as.data.frame(x[, c("name", "effectName", "include", "fix",
- "test", "initialValue", "parm")])
- specs.br <- x$basicRate
- if (includeOnly)
- {
- specs <- specs[x$include, ]
- row.names(specs) <- 1:nrow(specs)
- }
- if (dropRates)
- {
- specs.br <- specs.br[x$include]
- specs <- specs[!specs.br, ]
- }
- if (nDependents == 1)
- {
- specs <- specs[, -1] # drop name of dependent variable
- }
- if (any(endowments))
- {
- specs <- cbind(specs, type=x[x$include, "type"])
- }
- if (any(timeDummies))
- {
- specs <- cbind(specs, timeDummy=x[x$include, "timeDummy"])
- }
- if (any(userSpecifieds))
- {
- specs <- cbind(specs, x[x$include, c("effect1", "effect2")])
- if (any (x$effect3[x$include] > 0))
- {
- specs <- cbind(specs, effect3=x[x$include, "effect3"])
- }
- }
- if (includeRandoms)
- {
- specs <- cbind(specs, randomEffects=x[x$include, "randomEffects"])
- }
- specs[, "initialValue"] <- format(round(specs$initialValue,digits=5),
- width=10)
- if (nrow(specs) > 0)
- {
- if (gmm)
- {
- cat(' For estimation by the Generalized Method of Moments\n')
- cat(' Effects\n')
- if (any(specs$type!='gmm'))
- {
- specs1 <- specs[specs$type!='gmm',]
- row.names(specs1) <- 1:nrow(specs1)
- print(as.matrix(specs1), quote=FALSE)
- }
- if (any(specs$type=='gmm'))
- {
- cat('\n Statistics\n')
- specs2 <- specs[specs$type=='gmm',]
- row.names(specs2) <- 1:nrow(specs2)
- print(as.matrix(specs2[,c(1:2,7)]), quote=FALSE)
- }
- }
- else
- {
- print(as.matrix(specs), quote=FALSE)
- }
- }
- else
- {
- print.data.frame(specs)
- }
- }
- else
- {
- print.data.frame(x)
- }
- if (includeRandoms)
- {
- nreff <- sum(x$randomEffects & x$include)
- nrate <- sum(x$basicRate & x$include & (x$group==2))
- if (nrate > 0) # else there is only one group, and counting should be different.
- {
- cat('Dimensions of priorMu and priorSigma for sienaBayes should be',
- nreff, '+', nrate, '=', nreff+nrate,'.\n')
- }
- else if (dim(x)[1] > 1)
- # to avoid the following if called from includeInteraction or setEffect
- {
- cat('There are', nreff, 'random effects.\n')
- }
- }
- if (typeof(fileName)=="character")
- {
- sink()
- }
- invisible(x)
+ interactions <- x[x$shortName %in% c("unspInt", "behUnspInt") & x$include &
+ x$effect1 > 0, ]
+ if (expandDummies)
+ {
+ if(includeOnly && !all(x[x$include, "timeDummy"] == ",")
+ || !all(x[, "timeDummy"] == "," ))
+ {
+ x <- sienaTimeFix(x)$effects
+ x <- fixUpEffectNames(x)
+ }
+ else
+ {
+ if (nrow(interactions) > 0)
+ {
+ x <- fixUpEffectNames(x)
+ }
+ }
+ }
+ if (nrow(x) > 0)
+ {
+ nDependents <- length(unique(x$name))
+ userSpecifieds <- x$shortName[x$include] %in%
+ c("unspInt", "behUnspInt")
+ endowments <- !x$type[x$include] %in% c("rate", "eval")
+ # includes creations and gmm
+ gmm <- any(x$type[x$include] %in% "gmm")
+ timeDummies <- !x$timeDummy[x$include] == ","
+ specs <- as.data.frame(x[, c("name", "effectName", "include", "fix",
+ "test", "initialValue", "parm")])
+ if (includeOnly)
+ {
+ included <- x$include
+ }
+ else
+ {
+ included <- rep(TRUE, nrow(x))
+ }
+ if (dropRates)
+ {
+ included <- included & !x$basicRate
+ }
+ specs <- specs[included, ]
+ if (nrow(specs) > 0)
+ {
+ row.names(specs) <- 1:nrow(specs)
+ }
+ if (nDependents == 1)
+ {
+ specs <- specs[, -1] # drop name of dependent variable
+ }
+ if (any(endowments))
+ {
+ specs <- cbind(specs, type=x[included, "type"])
+ }
+ if (any(timeDummies))
+ {
+ specs <- cbind(specs, timeDummy=x[included, "timeDummy"])
+ }
+ if (any(userSpecifieds))
+ {
+ specs <- cbind(specs, x[included, c("effect1", "effect2")])
+ if (any (x$effect3[included] > 0))
+ {
+ specs <- cbind(specs, effect3=x[included, "effect3"])
+ }
+ }
+ if (includeRandoms)
+ {
+ specs <- cbind(specs, randomEffects=x[included, "randomEffects"])
+ }
+ specs[, "initialValue"] <- format(round(specs$initialValue,digits=5),
+ width=10)
+ if (nrow(specs) > 0)
+ {
+ if (gmm)
+ {
+ cat(' For estimation by the Generalized Method of Moments\n')
+ cat(' Effects\n')
+ if (any(specs$type!='gmm'))
+ {
+ specs1 <- specs[specs$type!='gmm',]
+ row.names(specs1) <- 1:nrow(specs1)
+ print(as.matrix(specs1), quote=FALSE)
+ }
+ if (any(specs$type=='gmm'))
+ {
+ cat('\n Statistics\n')
+ specs2 <- specs[specs$type=='gmm',]
+ row.names(specs2) <- 1:nrow(specs2)
+ print(as.matrix(specs2[,c(1:2,7)]), quote=FALSE)
+ }
+ }
+ else
+ {
+ print(as.matrix(specs), quote=FALSE)
+ }
+ }
+ else
+ {
+ print.data.frame(specs)
+ }
+ }
+ else
+ {
+ print.data.frame(x)
+ }
+ if (includeRandoms)
+ {
+ nreff <- sum(x$randomEffects & x$include)
+ nrate <- sum(x$basicRate & x$include & (x$group==2))
+ if (nrate > 0) # else there is only one group, and counting should be different.
+ {
+ cat('Dimensions of priorMu and priorSigma for sienaBayes should be',
+ nreff, '+', nrate, '=', nreff+nrate,'.\n')
+ }
+ else if (dim(x)[1] > 1)
+ # to avoid the following if called from includeInteraction or setEffect
+ {
+ cat('There are', nreff, 'random effects.\n')
+ }
+ }
+ if (typeof(fileName)=="character")
+ {
+ sink()
+ }
+ invisible(x)
}
##@summary.sienaEffects Methods
summary.sienaEffects <- function(object, fileName=NULL, includeOnly=TRUE,
- expandDummies=FALSE, ...)
+ expandDummies=FALSE, ...)
{
- if (!inherits(object, "sienaEffects"))
- stop("not a legitimate Siena effects object")
- if (expandDummies && (includeOnly && !all(object[object$include,
- "timeDummy"] == ",")
- || !all(object[, "timeDummy"] == ",")))
- {
- object <- sienaTimeFix(object)$effects
- }
- if (includeOnly)
- {
- object <- object[object$include, ]
- }
- class(object) <- c("summary.sienaEffects", class(object))
- object
+ if (!inherits(object, "sienaEffects"))
+ stop("not a legitimate Siena effects object")
+ if (expandDummies && (includeOnly && !all(object[object$include,
+ "timeDummy"] == ",")
+ || !all(object[, "timeDummy"] == ",")))
+ {
+ object <- sienaTimeFix(object)$effects
+ }
+ if (includeOnly)
+ {
+ object <- object[object$include, ]
+ }
+ class(object) <- c("summary.sienaEffects", class(object))
+ object
}
##@print.summary.sienaEffects Methods
print.summary.sienaEffects <- function(x, fileName=NULL, ...)
{
- if (!inherits(x, "summary.sienaEffects"))
- stop("not a legitimate summary of a Siena effects object")
- ## find out if any columns need removing because they will not print
+ if (!inherits(x, "summary.sienaEffects"))
+ stop("not a legitimate summary of a Siena effects object")
+ ## find out if any columns need removing because they will not print
- problem <- sapply(x, function(x)
- {
- inherits(try(unlist(x[[1]]), silent=TRUE), "try-error")
- }
- )
- if (any(problem))
- {
- x1 <- x[, problem]
- x <- x[, !problem]
- }
- if (typeof(fileName)=="character")
- {
- sink(fileName, split=TRUE)
- }
- print.data.frame(x)
- if (any(problem))
- {
- lapply(x1, print)
- }
- if (typeof(fileName)=="character")
- {
- sink()
- }
- invisible(x)
+ problem <- sapply(x, function(x)
+ {
+ inherits(try(unlist(x[[1]]), silent=TRUE), "try-error")
+ }
+ )
+ if (any(problem))
+ {
+ x1 <- x[, problem]
+ x <- x[, !problem]
+ }
+ if (typeof(fileName)=="character")
+ {
+ sink(fileName, split=TRUE)
+ }
+ print.data.frame(x)
+ if (any(problem))
+ {
+ lapply(x1, print)
+ }
+ if (typeof(fileName)=="character")
+ {
+ sink()
+ }
+ invisible(x)
}
edit.sienaEffects <- function(name, ...)
{
- if (!interactive())
- {
- return(name)
- }
- ## store the original column order
- originalNames <- names(name)
- ## move function name and other things out of the way
- priorityColumns <- c("name", "effectName", "type", "include", "fix",
- "test", "initialValue", "parm", "shortName")
- priorityX <- name[, priorityColumns]
- notPriorityX <- name[, -c(match(priorityColumns, names(name)))]
- name <- cbind(priorityX, notPriorityX)
+ if (!interactive())
+ {
+ return(name)
+ }
+ ## store the original column order
+ originalNames <- names(name)
+ ## move function name and other things out of the way
+ priorityColumns <- c("name", "effectName", "type", "include", "fix",
+ "test", "initialValue", "parm", "shortName")
+ priorityX <- name[, priorityColumns]
+ notPriorityX <- name[, -c(match(priorityColumns, names(name)))]
+ name <- cbind(priorityX, notPriorityX)
- ## get edit.data.frame to do the actual edit
- tmp <- NextMethod(, , edit.row.names=FALSE)
+ ## get edit.data.frame to do the actual edit
+ tmp <- NextMethod(, , edit.row.names=FALSE)
- ## re-sort the columns
- tmp <- tmp[, match(originalNames, names(tmp))]
- class(tmp) <- c("sienaEffects", class(tmp))
- tmp
+ ## re-sort the columns
+ tmp <- tmp[, match(originalNames, names(tmp))]
+ class(tmp) <- c("sienaEffects", class(tmp))
+ tmp
}
##@updateSpecification Methods add specified effects from other effects object
updateSpecification <- function(effects.to, effects.from, name.to=NULL, name.from=NULL)
{
- if (!inherits(effects.to, "data.frame"))
- {
- stop("effects.to is not a data.frame")
- }
- if (!inherits(effects.from, "data.frame"))
- {
- stop("effects.from is not a data.frame")
- }
- if (is.null(name.from))
- {
- prevEffects <-
- effects.from[which((effects.from$type != 'gmm')&((effects.from$include))),]
- }
- else
- {
- if (!is.character(name.from))
- {
- stop("name.from should be a string")
- }
- prevEffects <-
- effects.from[which((effects.from$type != 'gmm')&((effects.from$include))&
- (effects.from$name == name.from)),]
- }
- oldlist <- apply(prevEffects, 1, function(x)
- paste(x[c("name", "shortName",
- "type", "groupName",
- "interaction1", "interaction2",
- "period", "effect1", "effect2", "effect3")],
- collapse="|"))
- efflist <- apply(effects.to, 1, function(x)
- paste(x[c("name", "shortName",
- "type", "groupName",
- "interaction1", "interaction2",
- "period", "effect1", "effect2", "effect3")],
- collapse="|"))
- if (!(is.null(name.to)))
- {
- if (!is.character(name.to))
- {
- stop("name.to should be a string")
- }
- else if (name.to == "all") # omit matching on "name"
- {
- oldlist <- apply(prevEffects, 1, function(x)
- paste(x[c("shortName",
- "type", "groupName",
- "interaction1", "interaction2",
- "period", "effect1", "effect2", "effect3")],
- collapse="|"))
- efflist <- apply(effects.to, 1, function(x)
- paste(x[c("shortName",
- "type", "groupName",
- "interaction1", "interaction2",
- "period", "effect1", "effect2", "effect3")],
- collapse="|"))
- }
- }
- use <- (efflist %in% oldlist)
- correspondence <- match(efflist, oldlist)
- if (!(is.null(name.to)))
- {
- if (name.to != "all")
- {
- use <- (use & (effects.to$name == name.to))
- }
- }
- effects.to$include[use] <- TRUE
- effects.to$fix[use] <- prevEffects$fix[correspondence][use]
- effects.to$test[use] <- prevEffects$test[correspondence][use]
- effects.to$parameter[use] <- prevEffects$parameter[correspondence][use]
- effects.to
+ if (!inherits(effects.to, "data.frame"))
+ {
+ stop("effects.to is not a data.frame")
+ }
+ if (!inherits(effects.from, "data.frame"))
+ {
+ stop("effects.from is not a data.frame")
+ }
+ if (is.null(name.from))
+ {
+ prevEffects <-
+ effects.from[which((effects.from$type != 'gmm')&((effects.from$include))),]
+ }
+ else
+ {
+ if (!is.character(name.from))
+ {
+ stop("name.from should be a string")
+ }
+ prevEffects <-
+ effects.from[which((effects.from$type != 'gmm')&((effects.from$include))&
+ (effects.from$name == name.from)),]
+ }
+ oldlist <- apply(prevEffects, 1, function(x)
+ paste(x[c("name", "shortName",
+ "type", "groupName",
+ "interaction1", "interaction2",
+ "period", "effect1", "effect2", "effect3")],
+ collapse="|"))
+ efflist <- apply(effects.to, 1, function(x)
+ paste(x[c("name", "shortName",
+ "type", "groupName",
+ "interaction1", "interaction2",
+ "period", "effect1", "effect2", "effect3")],
+ collapse="|"))
+ if (!(is.null(name.to)))
+ {
+ if (!is.character(name.to))
+ {
+ stop("name.to should be a string")
+ }
+ else if (name.to == "all") # omit matching on "name"
+ {
+ oldlist <- apply(prevEffects, 1, function(x)
+ paste(x[c("shortName",
+ "type", "groupName",
+ "interaction1", "interaction2",
+ "period", "effect1", "effect2", "effect3")],
+ collapse="|"))
+ efflist <- apply(effects.to, 1, function(x)
+ paste(x[c("shortName",
+ "type", "groupName",
+ "interaction1", "interaction2",
+ "period", "effect1", "effect2", "effect3")],
+ collapse="|"))
+ }
+ }
+ use <- (efflist %in% oldlist)
+ correspondence <- match(efflist, oldlist)
+ if (!(is.null(name.to)))
+ {
+ if (name.to != "all")
+ {
+ use <- (use & (effects.to$name == name.to))
+ }
+ }
+ effects.to$include[use] <- TRUE
+ effects.to$fix[use] <- prevEffects$fix[correspondence][use]
+ effects.to$test[use] <- prevEffects$test[correspondence][use]
+ effects.to$parameter[use] <- prevEffects$parameter[correspondence][use]
+ effects.to
}
\ No newline at end of file
Modified: pkg/RSienaTest/doc/RSiena_Manual.pdf
===================================================================
(Binary files differ)
Modified: pkg/RSienaTest/doc/RSiena_Manual.tex
===================================================================
--- pkg/RSienaTest/doc/RSiena_Manual.tex 2017-09-09 11:47:09 UTC (rev 317)
+++ pkg/RSienaTest/doc/RSiena_Manual.tex 2017-09-10 15:59:28 UTC (rev 318)
@@ -186,7 +186,7 @@
by Mark Huisman, Michael Schweinberger, and Christian Steglich.
This manual is frequently updated, mostly only in a minor way.
-This version was renewed for \RS version 1.2-1.
+This version was renewed for \RS version 1.2-3.
\end{abstract}
@@ -853,6 +853,9 @@
install \sfn{sna} and \sfn{igraph}.\\
You can just install \RS and the other packages
in the regular way from CRAN.
+ If you want to have detailed information about
+ what is available at CRAN, go to\\
+\url{http://cran.r-project.org/web/packages/RSiena/} .\\
However, it is advisable to have the latest version of \RS
or \sfn{RSienaTest} from R-Forge or the \SI website.
You can go to\\
@@ -881,24 +884,24 @@
\end{itemize}
Installation from a downloaded file can be done as follows, assuming
- the root name of the file is \texttt{RSienaTest\_1.1-308}, and filling in the correct path name.
+ the root name of the file is \texttt{RSienaTest\_1.2-3}, and filling in the correct path name.
It will be convenient to first navigate to the directory
containing the \RS binary or source file so that this is the current directory.
Then the pathname consists only of the filename.
\begin{itemize}
\item In \R from binary:\\
for Windows:\\
- \texttt{install.packages("pathname to RSienaTest\_1.2-1.zip", repos = NULL, type="binary")}\\
+ \texttt{install.packages("pathname to RSienaTest\_1.2-3.zip", repos = NULL, type="binary")}\\
for Mac:\\
- \texttt{install.packages("pathname to RSienaTest\_1.2-1.tgz", repos = NULL, type="binary")}
+ \texttt{install.packages("pathname to RSienaTest\_1.2-3.tgz", repos = NULL, type="binary")}
\item In \R from source:\\
- \texttt{install.packages("RSienaTest\_1.2-1.tar.gz", repos = NULL, type="source")}
+ \texttt{install.packages("RSienaTest\_1.2-3.tar.gz", repos = NULL, type="source")}
\item In \text{command.com} or in batch mode (Windows) from binary:\\
- \texttt{R CMD INSTALL RSienaTest\_1.2-1.zip}
+ \texttt{R CMD INSTALL RSienaTest\_1.2-3.zip}
\item In the terminal (Mac) from binary:\\
- \texttt{R CMD INSTALL RSienaTest\_1.2-1.tgz}
+ \texttt{R CMD INSTALL RSienaTest\_1.2-3.tgz}
\item In \text{command.com} or in batch mode (Windows) or in the terminal (Mac) from source:\\
- \texttt{R CMD INSTALL RSienaTest\_1.2-1.tar.gz}
+ \texttt{R CMD INSTALL RSienaTest\_1.2-3.tar.gz}
\item In drop-down menu in \Rn:\\
for Windows: go to Packages $\rightarrow$ Install package(s) from local zip file\\
for Mac: go to Packages \& Data $\rightarrow$ Package Installer
@@ -1096,7 +1099,7 @@
of \rs. Details of the latest version available can
be found at \small{\url{http://r-forge.r-project.org/R/?group_id=461}}.
The version is
- identified by a version number (e.g.\ 1.2-1) and an R-Forge revision
+ identified by a version number (e.g.\ 1.2-3) and an R-Forge revision
number. You can find both numbers of your current installed version by
opening \R, and typing \\
\verb|packageDescription("RSiena")|. The version is
@@ -1306,8 +1309,8 @@
Missing values must be indicated in the way usual for \Rn,
by \texttt{NA}.
-For data specification by the graphical interface \textsf{siena01Gui}
-or by the function \textsf{sienaDataCreateFromSession},
+For data specification by the function
+\textsf{sienaDataCreateFromSession},
instead of \texttt{NA} any numerical code can be used
given that this is indicated to be a missing value code.
@@ -13560,12 +13563,6 @@
& \multicolumn{1}{c}{\textbf{Syntax}} &
\multicolumn{1}{c}{\textbf{Examples}} &
\multicolumn{1}{c}{\textbf{Description}} \\
- \cline{1-5}
- 1 &help\tnote{*} & help(funame) & help(siena01Gui) &
- Opens the help on the function named ``funame''; this can also be done by
- typing ``?'' followed by ``funame'' in the console.
- This is the general way to get information about further options
- of this function. \\
\hline
1 &getwd &getwd() & &
Returns the name of the current working directory.
@@ -13656,12 +13653,6 @@
Only for Windows. Does not require arguments\\
\hline
-%3 -- 5& siena01Gui& siena01Gui()& & Does not require arguments.
-% Opens a GUI to be used to run the model estimation or to create a session
-% from which to work within \Rn. Details on how to run the estimation under
-% the GUI can be found in section \ref{thegui} and \ref{estgui}.\\
-%\hline
-
3 &sienaNodeSet &sienaNodeSet (n, \newline
nodeSetName= ``Actors'', \newline
names=NULL) & &
Modified: pkg/RSienaTest/man/RSiena-package.Rd
===================================================================
--- pkg/RSienaTest/man/RSiena-package.Rd 2017-09-09 11:47:09 UTC (rev 317)
+++ pkg/RSienaTest/man/RSiena-package.Rd 2017-09-10 15:59:28 UTC (rev 318)
@@ -47,7 +47,7 @@
Package: \tab RSienaTest\cr
Type: \tab Package\cr
Version: \tab 1.2-3\cr
-Date: \tab 2017-09-08\cr
+Date: \tab 2017-09-10\cr
Depends: \tab R (>= 3.0.0)\cr
Imports: \tab Matrix\cr
Suggests: \tab tcltk, network, codetools, lattice, MASS, parallel,
Modified: pkg/RSienaTest/man/sienaBayes.Rd
===================================================================
--- pkg/RSienaTest/man/sienaBayes.Rd 2017-09-09 11:47:09 UTC (rev 317)
+++ pkg/RSienaTest/man/sienaBayes.Rd 2017-09-10 15:59:28 UTC (rev 318)
@@ -264,7 +264,9 @@
FourEffects <- setEffect(FourEffects, density, random=TRUE)
[TRUNCATED]
To get the complete diff run:
svnlook diff /svnroot/rsiena -r 318
More information about the Rsiena-commits
mailing list