diff --git a/R/misc_and_utility.R b/R/misc_and_utility.R index b06731203..d190a6c0e 100644 --- a/R/misc_and_utility.R +++ b/R/misc_and_utility.R @@ -4519,6 +4519,7 @@ umx_scale <- function(df, varsToScale = NULL, coerce = FALSE, attr = FALSE, verb #' umx_is_class(mtcars, c("character", "numeric")) #' # Is zygosity a factor (note we don't drop = F to keep as dataframe) #' umx_is_class(twinData[,"zygosity", drop=FALSE], classes = "factor") +#' umx_is_class(mtcars$mpg) # report class of this column (same as class(mpg)) umx_is_class <- function(df, classes=NULL, all = TRUE){ if(!is.data.frame(df)){ if(is.null(classes)){ @@ -4532,7 +4533,7 @@ umx_is_class <- function(df, classes=NULL, all = TRUE){ i = 1 if(is.null(classes)){ for (n in colNames) { - bIsOK[i] = class(df[, n])[1] + bIsOK[i] = class(df[, n, drop = TRUE])[1] i = i + 1 } return(bIsOK) diff --git a/man/umxPower.Rd b/man/umxPower.Rd index d402b8d64..a6a3a1305 100644 --- a/man/umxPower.Rd +++ b/man/umxPower.Rd @@ -98,28 +98,28 @@ pwr::pwr.r.test(r = .3, n = 90) umxPower(m1, "X_with_Y", n= 90, method = "empirical", explore = TRUE) # Search X_with_Y:power relationship for n=90 -| | X_with_Y | power | lower | upper | -|:---|:-----------|:----------|:----------|:----------| -| 1 | 0.08800859 | 0.2689414 | 0.1596095 | 0.4160855 | -| 2 | 0.10066598 | 0.3236951 | 0.2117817 | 0.4602180 | -| 3 | 0.11332337 | 0.3837446 | 0.2747536 | 0.5058168 | -| 4 | 0.12598077 | 0.4475620 | 0.3469889 | 0.5526166 | -| 5 | 0.13863816 | 0.5131549 | 0.4249318 | 0.6005657 | -| 6 | 0.15129555 | 0.5782978 | 0.5032166 | 0.6499256 | -| 7 | 0.16395294 | 0.6408252 | 0.5758201 | 0.7010404 | -| 8 | 0.17661033 | 0.6989084 | 0.6383710 | 0.7532292 | -| 9 | 0.18926773 | 0.7512450 | 0.6901890 | 0.8036907 | -| 10 | 0.20192512 | 0.7971249 | 0.7332804 | 0.8488375 | -| 11 | 0.21458251 | 0.8363858 | 0.7698677 | 0.8865116 | -| 12 | 0.22723990 | 0.8692947 | 0.8014434 | 0.9163789 | -| 13 | 0.23989729 | 0.8964042 | 0.8289134 | 0.9392231 | -| 14 | 0.25255468 | 0.9184186 | 0.8528663 | 0.9562632 | -| 15 | 0.26521208 | 0.9360885 | 0.8737344 | 0.9687514 | -| 16 | 0.27786947 | 0.9501390 | 0.8918717 | 0.9777896 | -| 17 | 0.29052686 | 0.9612285 | 0.9075880 | 0.9842729 | -| 18 | 0.30318425 | 0.9699297 | 0.9211637 | 0.9888940 | -| 19 | 0.31584164 | 0.9767254 | 0.9328545 | 0.9921728 | -| 20 | 0.32849904 | 0.9820138 | 0.9428939 | 0.9944916 | +# | | X_with_Y | power | lower | upper | +# |:---|:---------|:------|:------|:------| +# | 1 | 0.03 | 0.27 | 0.15 | 0.44 | +# | 2 | 0.03 | 0.32 | 0.20 | 0.48 | +# | 3 | 0.04 | 0.38 | 0.26 | 0.53 | +# | 4 | 0.04 | 0.45 | 0.33 | 0.57 | +# | 5 | 0.04 | 0.51 | 0.41 | 0.61 | +# | 6 | 0.05 | 0.58 | 0.49 | 0.66 | +# | 7 | 0.05 | 0.64 | 0.57 | 0.71 | +# | 8 | 0.06 | 0.70 | 0.64 | 0.75 | +# | 9 | 0.06 | 0.75 | 0.69 | 0.80 | +# | 10 | 0.06 | 0.80 | 0.74 | 0.85 | +# | 11 | 0.07 | 0.84 | 0.77 | 0.88 | +# | 12 | 0.07 | 0.87 | 0.80 | 0.92 | +# | 13 | 0.08 | 0.90 | 0.83 | 0.94 | +# | 14 | 0.08 | 0.92 | 0.85 | 0.96 | +# | 15 | 0.08 | 0.94 | 0.87 | 0.97 | +# | 16 | 0.09 | 0.95 | 0.89 | 0.98 | +# | 17 | 0.09 | 0.96 | 0.91 | 0.98 | +# | 18 | 0.10 | 0.97 | 0.92 | 0.99 | +# | 19 | 0.10 | 0.98 | 0.93 | 0.99 | +# | 20 | 0.10 | 0.98 | 0.94 | 0.99 | } diff --git a/man/umx_is_class.Rd b/man/umx_is_class.Rd index b7b943390..1459585c5 100644 --- a/man/umx_is_class.Rd +++ b/man/umx_is_class.Rd @@ -34,6 +34,7 @@ umx_is_class(mtcars, "numeric") # TRUE umx_is_class(mtcars, c("character", "numeric")) # Is zygosity a factor (note we don't drop = F to keep as dataframe) umx_is_class(twinData[,"zygosity", drop=FALSE], classes = "factor") +umx_is_class(mtcars$mpg) # report class of this column (same as class(mpg)) } \references{ \itemize{ diff --git a/man/umx_set_silent.Rd b/man/umx_set_silent.Rd index a8b564580..2adf573e0 100644 --- a/man/umx_set_silent.Rd +++ b/man/umx_set_silent.Rd @@ -22,10 +22,10 @@ If TRUE, then the progress messages from model runs are suppressed. Useful for p } \examples{ library(umx) -umx_set_silent() # print existing value -old = umx_set_silent(silent = TRUE) # store existing value -umx_set_silent(FALSE) # set to FALSE +old = umx_set_silent() # print & store existing value +umx_set_silent(FALSE, silent = TRUE) # set to FALSE umx_set_silent(old) # reinstate +umx_set_silent() # print existing value } \references{ \itemize{