Skip to content

Commit

Permalink
updates to pass CRAN and GitHub checks
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexChristensen committed Sep 4, 2022
1 parent f4fb245 commit 05718d7
Show file tree
Hide file tree
Showing 13 changed files with 82 additions and 80 deletions.
3 changes: 2 additions & 1 deletion R/dynEGA.ind.pop.R
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@
#' # Obtain data
#' sim.dynEGA <- sim.dynEGA # bypasses CRAN checks
#'
#' \donttest{# Dynamic EGA individual and population structure
#' \dontrun{
#' # Dynamic EGA individual and population structure
#' dyn.ega1 <- dynEGA.ind.pop(
#' data = sim.dynEGA, n.embed = 5, tau = 1,
#' delta = 1, id = 25, use.derivatives = 1,
Expand Down
50 changes: 26 additions & 24 deletions R/methods.section.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,48 +44,50 @@
#' @return Automated HTML Methods section in your default browser
#'
#' @examples
#' \donttest{# Estimate EGA
#' ## plot.type = "qqraph" used for CRAN checks
#' ## plot.type = "GGally" is the default
#' ega.wmt <- EGA(data = wmt2[,7:24], plot.type = "qgraph")
#' }
#' # Load data
#' wmt <- wmt2[,7:24]
#'
#' \dontrun{
#' # Estimate EGA
#' ega.wmt <- EGA(data = wmt)
#'
#' # EGA Methods section
#' if(interactive()){
#' methods.section(ega.wmt)
#' }
#'
#' \donttest{# Estimate standardized network loadings
#' # Estimate standardized network loadings
#' wmt.loads <- net.loads(ega.wmt)$std
#' }
#'
#' # EGA Methods section with network loadings
#' if(interactive()){
#' methods.section(ega.wmt, stats = "net.loads")
#' }
#'
#' \dontrun{# bootEGA example
#' # bootEGA example
#' ## plot.type = "qqraph" used for CRAN checks
#' ## plot.type = "GGally" is the default
#' boot.wmt <- bootEGA(data = wmt2[,7:24], iter = 500, plot.type = "qgraph",
#' type = "parametric", ncores = 2)
#' }
#' boot.wmt <- bootEGA(
#' data = wmt, iter = 500,
#' type = "parametric", ncores = 2
#' )
#'
#' # EGA and bootEGA Methods section
#' if(interactive()){
#' methods.section(ega.wmt, boot.wmt)
#' }
#'
#' \donttest{# Estimate structural consistency
#' # Estimate structural consistency
#' sc.wmt <- dimensionStability(boot.wmt)
#' }
#'
#' # EGA and bootEGA Methods section with structural consistency and item stability
#' if(interactive()){
#' methods.section(boot.wmt, stats = c("dimensionStability", "itemStability"))
#' }
#'
#' # EGA with network loadings and
#' # bootEGA Methods section with structural consistency and item stability
#' if(interactive()){
#' methods.section(ega.wmt, boot.wmt, stats = c("net.loads", "dimensionStability", "itemStability"))
#' }
#' methods.section(
#' ega.wmt,
#' boot.wmt,
#' stats = c(
#' "net.loads",
#' "dimensionStability",
#' "itemStability"
#' )
#' )}
#'
#' @importFrom utils packageVersion browseURL
#'
Expand Down
6 changes: 4 additions & 2 deletions R/net.loads.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,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 All @@ -64,7 +65,8 @@
#' # Network loadings
#' net.loads(ega.wmt)
#'
#' \donttest{# Produce Methods section
#' \dontrun{
#' # Produce Methods section
#' methods.section(
#' ega.wmt,
#' stats = "net.loads"
Expand Down
6 changes: 4 additions & 2 deletions R/net.scores.R
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,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 All @@ -78,7 +79,8 @@
#' # Network scores
#' net.scores(data = wmt, A = ega.wmt)
#'
#' \donttest{# Produce Methods section
#' \dontrun{
#' # Produce Methods section
#' methods.section(
#' ega.wmt,
#' stats = "net.scores"
Expand Down
7 changes: 3 additions & 4 deletions R/residualEGA.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,16 @@
#' @author Hudson F. Golino <hfg9s at virginia.edu> and Robert Moulder <rgm4fd@virginia.edu>
#'
#' @examples
#'
#' # Load data
#' data <- optimism
#'
#' \dontrun{
#' # resEGA example
#' # Residual EGA example
#' opt.res <- residualEGA(data = data, manifests = colnames(optimism),
#' lat = 1, negative.items = c(3,7,9))
#'
#' # Fit:
#' opt.res$Fit
#' }
#' opt.res$Fit}
#'
#' @seealso \code{\link[EGAnet]{EGA}} to estimate the number of dimensions of an instrument using EGA
#' and \code{\link[EGAnet]{CFA}} to verify the fit of the structure suggested by EGA using confirmatory factor analysis.
Expand Down
7 changes: 1 addition & 6 deletions R/simDFM.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,12 @@
#' Set to \code{TRUE} to add slight variation to all parameters
#'
#' @examples
#'
#'
#' \dontrun{
#' \donttest{
#' # Estimate EGA network
#' data1 <- simDFM(variab = 5, timep = 50, nfact = 3, error = 0.05,
#' dfm = "DAFS", loadings = 0.7, autoreg = 0.8,
#' crossreg = 0.1, var.shock = 0.18,
#' cov.shock = 0.36, burnin = 1000)
#' }
#'}
#' cov.shock = 0.36, burnin = 1000)}
#'
#' @references
#' Engle, R., & Watson, M. (1981).
Expand Down
4 changes: 2 additions & 2 deletions R/utils-EGAnet.R
Original file line number Diff line number Diff line change
Expand Up @@ -7029,7 +7029,7 @@ parallel_process <- function(
count_computations <- 0

# Create data splits (necessary for progress bar)
if(iter <= 100 | os != "windows"){
if(total_computations <= 100 | os != "windows"){

# Split computations
split_computations <- ncores
Expand Down Expand Up @@ -7077,7 +7077,7 @@ parallel_process <- function(
)

# Batch splits
batch_computations <- round(iter / 100)
batch_computations <- round(total_computations / 100)

# Set start and end points of data batches
batch_start <- seq(1, length(split_end), batch_computations)
Expand Down
3 changes: 2 additions & 1 deletion man/dynEGA.ind.pop.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 26 additions & 24 deletions man/methods.section.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions man/net.loads.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions man/net.scores.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions man/residualEGA.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 1 addition & 6 deletions man/simDFM.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 05718d7

Please sign in to comment.