Skip to content

Commit

Permalink
Merge pull request #41 from jhorzek/CRAN
Browse files Browse the repository at this point in the history
removing example for internal function
  • Loading branch information
jhorzek authored Aug 9, 2023
2 parents 5a0ca58 + 5d92333 commit 946945a
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 31 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: mxsem
Type: Package
Title: Specify 'OpenMx' Models with a 'lavaan'-Like Syntax
Version: 0.0.3
Title: Specify 'OpenMx' Models with a 'lavaan'-Style Syntax
Version: 0.0.4
Date: 2023-07-12
Authors@R: c(person(given = "Jannik H.", family = "Orzek",
role = c("aut", "cre", "cph"),
Expand Down
5 changes: 0 additions & 5 deletions R/extract_algebra_elements.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@
#' @param extracted used in recursive function calls; don't set this manually
#' @return vector with names of variables and parameters used in the function call
#' @keywords internal
#' @examples
#' library(mxsem)
#' simple_algebra <- mxAlgebraFromString("exp(b + c)", name = "a")
#'
#' mxsem:::extract_algebra_elements(simple_algebra@formula)
extract_algebra_elements <- function(mxAlgebra_formula, extracted = c()){

for(i in 1:length(mxAlgebra_formula)){
Expand Down
3 changes: 1 addition & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ Because **mxsem** implements the syntax parser from scratch, it can extend the
## Citation

Cite **OpenMx** (Boker et al., 2011) for the modeling and **lavaan** for the
syntax (Rosseel, 2012). **mxsem** itself is just a very small package and lets
**OpenMx** do all the heavy lifting.
syntax (Rosseel, 2012). To cite **mxsem**, check `citation("mxsem")`.

## Installation

Expand Down
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ curly braces.
## Citation

Cite **OpenMx** (Boker et al., 2011) for the modeling and **lavaan** for
the syntax (Rosseel, 2012). **mxsem** itself is just a very small
package and lets **OpenMx** do all the heavy lifting.
the syntax (Rosseel, 2012). To cite **mxsem**, check
`citation("mxsem")`.

## Installation

Expand Down Expand Up @@ -159,8 +159,8 @@ Show summary
#> AIC: 1528.9445 3178.945 3283.308
#> BIC: -287.9662 3273.962 3144.740
#> To get additional fit indices, see help(mxRefModels)
#> timestamp: 2023-08-03 11:27:39
#> Wall clock time: 0.2723861 secs
#> timestamp: 2023-08-09 08:07:01
#> Wall clock time: 0.3236761 secs
#> optimizer: SLSQP
#> OpenMx version number: 2.21.8
#> Need help? See help(mxSummary)
Expand Down Expand Up @@ -252,8 +252,8 @@ Show summary
#> AIC: 1607.0759 3257.076 3321.691
#> BIC: -223.7397 3338.188 3227.877
#> To get additional fit indices, see help(mxRefModels)
#> timestamp: 2023-08-03 11:27:40
#> Wall clock time: 0.0548799 secs
#> timestamp: 2023-08-09 08:07:02
#> Wall clock time: 0.053231 secs
#> optimizer: SLSQP
#> OpenMx version number: 2.21.8
#> Need help? See help(mxSummary)
Expand Down Expand Up @@ -351,8 +351,8 @@ Show summary
#> AIC: 821.2609 861.2609 863.7328
#> BIC: 795.2092 887.3126 855.7301
#> To get additional fit indices, see help(mxRefModels)
#> timestamp: 2023-08-03 11:27:42
#> Wall clock time: 0.2586932 secs
#> timestamp: 2023-08-09 08:07:04
#> Wall clock time: 0.2974899 secs
#> optimizer: SLSQP
#> OpenMx version number: 2.21.8
#> Need help? See help(mxSummary)
Expand Down Expand Up @@ -454,8 +454,8 @@ Show summary
#> AIC: 461.3822 515.3822 526.0151
#> BIC: 443.1460 567.4856 504.3206
#> To get additional fit indices, see help(mxRefModels)
#> timestamp: 2023-08-03 11:27:42
#> Wall clock time: 0.03566003 secs
#> timestamp: 2023-08-09 08:07:04
#> Wall clock time: 0.0394721 secs
#> optimizer: SLSQP
#> OpenMx version number: 2.21.8
#> Need help? See help(mxSummary)
Expand Down Expand Up @@ -526,8 +526,8 @@ Show summary
#> AIC: 461.3822 515.3822 526.0151
#> BIC: 443.1460 567.4856 504.3206
#> To get additional fit indices, see help(mxRefModels)
#> timestamp: 2023-08-03 11:27:42
#> Wall clock time: 0.03693199 secs
#> timestamp: 2023-08-09 08:07:04
#> Wall clock time: 0.03983593 secs
#> optimizer: SLSQP
#> OpenMx version number: 2.21.8
#> Need help? See help(mxSummary)
Expand Down Expand Up @@ -598,8 +598,8 @@ Show summary
#> AIC: 461.3822 515.3822 526.0151
#> BIC: 443.1460 567.4856 504.3206
#> To get additional fit indices, see help(mxRefModels)
#> timestamp: 2023-08-03 11:27:43
#> Wall clock time: 0.03773284 secs
#> timestamp: 2023-08-09 08:07:05
#> Wall clock time: 0.04041314 secs
#> optimizer: SLSQP
#> OpenMx version number: 2.21.8
#> Need help? See help(mxSummary)
Expand Down Expand Up @@ -701,8 +701,8 @@ Show summary
#> AIC: 1551.1683 3201.168 3265.784
#> BIC: -279.6473 3282.280 3171.970
#> To get additional fit indices, see help(mxRefModels)
#> timestamp: 2023-08-03 11:27:43
#> Wall clock time: 0.09258008 secs
#> timestamp: 2023-08-09 08:07:05
#> Wall clock time: 0.10127 secs
#> optimizer: SLSQP
#> OpenMx version number: 2.21.8
#> Need help? See help(mxSummary)
Expand Down
6 changes: 0 additions & 6 deletions man/extract_algebra_elements.Rd

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

8 changes: 8 additions & 0 deletions tests/testthat/test-extract_algebra.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
test_that("extracting algebra", {
library(mxsem)
simple_algebra <- mxAlgebraFromString("exp(b + c)", name = "a")

alg <- mxsem:::extract_algebra_elements(simple_algebra@formula)

testthat::expect_equal(alg, c("b", "c"))
})

0 comments on commit 946945a

Please sign in to comment.