Skip to content

Commit

Permalink
documentation updates to pass CRAN
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexChristensen committed Sep 4, 2022
1 parent 5b68ac5 commit f4fb245
Show file tree
Hide file tree
Showing 71 changed files with 371 additions and 623 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: EGAnet
Title: Exploratory Graph Analysis – a Framework for Estimating the Number of Dimensions in Multivariate Data using Network Psychometrics
Version: 1.2.3
Date: 2022-26-08
Date: 2022-09-04
Authors@R: c(person("Hudson", "Golino", email = "hfg9s@virginia.edu", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-1601-1447")),
person("Alexander", "Christensen", email = "alexpaulchristensen@gmail.com", role = "aut", comment = c(ORCID = "0000-0002-9798-7037")),
person("Robert", "Moulder", email = "rgm4fd@virginia.edu", role = "ctb", comment = c(ORCID = "0000-0001-7504-9560")),
Expand Down
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ o FIX: many bug fixes related to latest update; functions have largely returned

o UPDATE: Mac and Linux parallelizations have been optimized

o UPDATE: documented examples are more efficient for CRAN checks


Changes in 1.2.1

Expand Down
Binary file removed R/.DS_Store
Binary file not shown.
3 changes: 2 additions & 1 deletion R/CFA.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
#' # Load data
#' wmt <- wmt2[,7:24]
#'
#' \donttest{# Estimate EGA
#' \dontrun{
#' # Estimate EGA
#' ega.wmt <- EGA(
#' data = wmt,
#' plot.EGA = FALSE # No plot for CRAN checks
Expand Down
3 changes: 2 additions & 1 deletion R/EBICglasso.qgraph.R
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@
#' # Obtain data
#' wmt <- wmt2[,7:24]
#'
#' \donttest{# Compute graph with tuning = 0 (BIC)
#' \dontrun{
#' # Compute graph with tuning = 0 (BIC)
#' BICgraph <- EBICglasso.qgraph(
#' data = wmt, gamma = 0
#' )
Expand Down
17 changes: 7 additions & 10 deletions R/EGA.R
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@
#' # Obtain data
#' wmt <- wmt2[,7:24]
#'
#' \donttest{# Estimate EGA
#' \dontrun{
#' # Estimate EGA
#' ega.wmt <- EGA(
#' data = wmt,
#' plot.EGA = FALSE # No plot for CRAN checks
Expand All @@ -218,30 +219,26 @@
#'
#' # Produce Methods section
#' methods.section(ega.wmt)
#'
#'
#' # Estimate EGAtmfg
#' ega.wmt.tmfg <- EGA(
#' data = wmt, model = "TMFG",
#' plot.EGA = FALSE # No plot for CRAN checks
#' data = wmt, model = "TMFG"
#' )
#'
#' # Estimate EGA with Louvain algorithm
#' ega.wmt.louvain <- EGA(
#' data = wmt, algorithm = "louvain",
#' plot.EGA = FALSE # No plot for CRAN checks
#' data = wmt, algorithm = "louvain"
#' )
#'
#' # Estimate EGA with Leiden algorithm
#' ega.wmt.leiden <- EGA(
#' data = wmt, algorithm = "leiden",
#' plot.EGA = FALSE # No plot for CRAN checks
#' data = wmt, algorithm = "leiden"
#' )
#'
#' # Estimate EGA with Spinglass algorithm
#' ega.wmt.spinglass <- EGA(
#' data = wmt,
#' algorithm = igraph::cluster_spinglass, # any {igraph} algorithm
#' plot.EGA = FALSE # No plot for CRAN checks
#' algorithm = igraph::cluster_spinglass
#' )}
#'
#' @seealso \code{\link{bootEGA}} to investigate the stability of EGA's estimation via bootstrap
Expand Down
3 changes: 2 additions & 1 deletion R/EGA.estimate.R
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@
#' # Obtain data
#' wmt <- wmt2[,7:24]
#'
#' \donttest{# Estimate EGA
#' \dontrun{
#' # Estimate EGA
#' ega.wmt <- EGA.estimate(data = wmt)
#'
#' # Estimate EGAtmfg
Expand Down
3 changes: 2 additions & 1 deletion R/EGA.fit.R
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@
#' # Load data
#' wmt <- wmt2[,7:24]
#'
#' \donttest{# Estimate EGA
#' \dontrun{
#' # Estimate EGA
#' ega.wmt <- EGA(
#' data = wmt,
#' plot.EGA = FALSE # No plot for CRAN checks
Expand Down
8 changes: 3 additions & 5 deletions R/LCT.R
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,12 @@
#'
#' @examples
#' \donttest{# Compute LCT
#' ## Network model
#' LCT(data = wmt2[,7:24])
#'
#' ## Factor model
#' LCT(data = psychTools::bfi[,1:25])
#' LCT(data = psychTools::bfi[,1:25])}
#'
#' \dontrun{
#' # Dynamic LCT
#' LCT(sim.dynEGA[sim.dynEGA$ID == 1,1:20], dynamic = TRUE)}
#' LCT(sim.dynEGA[sim.dynEGA$ID == 1,1:24], dynamic = TRUE)}
#'
#'
#' @references
Expand Down
6 changes: 3 additions & 3 deletions R/UVA.R
Original file line number Diff line number Diff line change
Expand Up @@ -259,16 +259,16 @@
#' key.ind <- match(colnames(items), as.character(psychTools::spi.dictionary$item_id))
#' key <- as.character(psychTools::spi.dictionary$item[key.ind])
#'
#' \donttest{# Automated selection of local dependence (default)
#' \dontrun{
#' # Automated selection of local dependence (default)
#' uva.results <- UVA(data = items, key = key)
#'
#' # Produce Methods section
#' methods.section(uva.results)}
#'
#' # Manual selection of local dependence
#' if(interactive()){
#' uva.results <- UVA(data = items, key = key, auto = FALSE)
#' }
#' uva.results <- UVA(data = items, key = key, auto = FALSE)}
#'
#' @references
#' # Simulation using \code{UVA} \cr
Expand Down
20 changes: 12 additions & 8 deletions R/boot.ergoInfo.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#' random noise is added to the edges of the population structure to simulate sampling variability. This noise
#' follows a random uniform distribution ranging from -0.10 to 0.10. In addition, a proportion of edges are
#' rewired to allow for slight variations on the population structure. The proportion of nodes that are rewired
#' is sampled from a random uniform distribution between 0.20 to 0.25. This process is carried out for each
#' is sampled from a random uniform distribution between 0.20 to 0.40. This process is carried out for each
#' participant resulting in \emph{n} variations of the population structure. Afterward, EII is computed. This
#' process is carried out for \emph{i} iterations (e.g., 100).
#'
Expand Down Expand Up @@ -47,15 +47,19 @@
#' For Windows, \code{FALSE} is about 2x faster
#'
#' @examples
#' \donttest{# Dynamic EGA individual and population structures
#' # Obtain simulated data
#' sim.data <- sim.dynEGA
#'
#' \dontrun{
#' # Dynamic EGA individual and population structures
#' dyn1 <- dynEGA.ind.pop(
#' data = sim.dynEGA[,-c(22)], n.embed = 5, tau = 1,
#' delta = 1, id = 21, use.derivatives = 1,
#' data = sim.dynEGA[,-26], n.embed = 5, tau = 1,
#' delta = 1, id = 25, use.derivatives = 1,
#' model = "glasso", ncores = 2, corr = "pearson"
#' )
#'
#' # Empirical Ergodicity Information Index
#' eii1 <- ergoInfo(dynEGA.object = dyn1, use = "edge.list")
#' eii1 <- ergoInfo(dynEGA.object = dyn1, use = "weighted")
#'
#' # Bootstrap Test for Ergodicity Information Index
#' testing.ergoinfo <- boot.ergoInfo(
Expand Down Expand Up @@ -88,7 +92,7 @@
#'
#' @export
# Bootstrap Test for the Ergodicity Information Index
# Updated 28.08.2022
# Updated 04.09.2022
boot.ergoInfo <- function(
dynEGA.object,
EII, iter = 100,
Expand Down Expand Up @@ -180,8 +184,8 @@ boot.ergoInfo <- function(
function(i){
dynEGA.ind[[i]]$network <- rewire(
dynEGA.pop$dynEGA$network,
min = 0.20, max = 0.25,
noise = NULL
min = 0.20, max = 0.40,
noise = 0.10
)
return(dynEGA.ind[[i]])
}
Expand Down
23 changes: 9 additions & 14 deletions R/bootEGA.R
Original file line number Diff line number Diff line change
Expand Up @@ -281,11 +281,11 @@
#' @examples
#' # Load data
#' wmt <- wmt2[,7:24]
#'
#' \donttest{# Standard EGA example
#'
#' \dontrun{
#' # Standard EGA example
#' boot.wmt <- bootEGA(
#' data = wmt, iter = 100, # recommended 500
#' plot.typicalStructure = FALSE, # No plot for CRAN checks
#' data = wmt, iter = 500,
#' type = "parametric", ncores = 2
#' )
#'
Expand All @@ -294,41 +294,36 @@
#'
#' # Louvain example
#' boot.wmt.louvain <- bootEGA(
#' data = wmt, iter = 100, # recommended 500
#' data = wmt, iter = 500,
#' algorithm = "louvain",
#' plot.typicalStructure = FALSE, # No plot for CRAN checks
#' type = "parametric", ncores = 2
#' )
#'
#' # Spinglass example
#' boot.wmt.spinglass <- bootEGA(
#' data = wmt, iter = 100, # recommended 500
#' data = wmt, iter = 500,
#' algorithm = igraph::cluster_spinglass, # use any function from {igraph}
#' plot.typicalStructure = FALSE, # No plot for CRAN checks
#' type = "parametric", ncores = 2
#' )
#'
#' # EGA fit example
#' boot.wmt.fit <- bootEGA(
#' data = wmt, iter = 100, # recommended 500
#' data = wmt, iter = 500,
#' EGA.type = "EGA.fit",
#' plot.typicalStructure = FALSE, # No plot for CRAN checks
#' type = "parametric", ncores = 2
#' )
#'
#' # Hierarchical EGA example
#' boot.wmt.hier <- bootEGA(
#' data = wmt, iter = 100, # recommended 500
#' data = wmt, iter = 500,
#' EGA.type = "hierEGA",
#' plot.typicalStructure = FALSE, # No plot for CRAN checks
#' type = "parametric", ncores = 2
#' )
#'
#' # Random-intercept EGA example
#' boot.wmt.ri <- bootEGA(
#' data = wmt, iter = 100, # recommended 500
#' data = wmt, iter = 500,
#' EGA.type = "riEGA",
#' plot.typicalStructure = FALSE, # No plot for CRAN checks
#' type = "parametric", ncores = 2
#' )}
#'
Expand Down
3 changes: 2 additions & 1 deletion R/compare.EGA.plots.R
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@
#' sample1 <- items[sample(1:nrow(items), 1000),]
#' sample2 <- items[sample(1:nrow(items), 1000),]
#'
#' \donttest{# Estimate EGAs
#' \dontrun{
#' # Estimate EGAs
#' ega1 <- EGA(sample1)
#' ega2 <- EGA(sample2)
#'
Expand Down
Loading

0 comments on commit f4fb245

Please sign in to comment.