From 5f7360079ae4c824a5d5806143401af296df136d Mon Sep 17 00:00:00 2001 From: ingorohlfing Date: Thu, 13 Feb 2020 11:55:38 +0100 Subject: [PATCH] Added library() commands --- vignettes/Introduction.Rmd | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/vignettes/Introduction.Rmd b/vignettes/Introduction.Rmd index 15b6030..a9bedd5 100644 --- a/vignettes/Introduction.Rmd +++ b/vignettes/Introduction.Rmd @@ -11,6 +11,11 @@ vignette: > %\VignetteEncoding{UTF-8} --- +```{r, include = F} +library(devtools) +devtools::load_all() +``` + ## Introduction The `R` package `qcapower` allows you to estimate power with regard to the consistency of a term generated in a Qualitative Comparative Analysis (QCA). Power is defined in the usual way as the probability of rejecting the null hypothesis when it is false. This vignette introduces the package, its in-built functions and what you can do with the functions' output. The package includes four functions: @@ -47,11 +52,12 @@ The role of the simulations and permutations is explained in the manuscript on w These processes are repeated until the consistency score of the dataset achieves the target value of `alt_hypo`. Because we do not constrain fuzzy-set memberships to two decimal places, it is unlikely that the iterative process does exactly meet the target score. For this reason, we introduce a tolerance parameter telling the `qcapower()` function when the actual consistency value is sufficiently close to the intended value and the iteration can be stopped. If one wants to exactly hit the target consistency level, one only has to set `cons_threshold` to 0. -```{r} -devtools::load_all() +```{r, include = F} +library(qcapower) +library(ggplot2) +library(ggforce) ``` - If you want to leave the default parameters as they are, you can, for example, estimate power for H1=1, H0=0.85 and n=15 with one line. The execution of `qcapower()` can take some time, depending on the settings for `cases`, `perms` and `sims`. We load simulation results into the memory that one would get from the first line in the following code block. ```{r qcapower example, eval = c(2, 3)} power_example <- qcapower(cases = 15, alt_hypo = 1, null_hypo = 0.85) @@ -115,7 +121,9 @@ The simulation has to start with a given number of cases (`start_value`). The de qp_cases_brute(power_target = 0.9, null_hypo = 0.80, alt_hypo = 1) ``` -### Packages used in this vignette +Packages used in this vignette and references +---------- + - base (R Core Team 2019) - ggforce (Lin Pedersen 2019) - ggplot2 (Wickham 2016) @@ -124,9 +132,6 @@ qp_cases_brute(power_target = 0.9, null_hypo = 0.80, alt_hypo = 1) - usethis (Wickham and Bryan 2019) - devtools (Wickham, Hester, and Chang 2019) -References ----------- - Pedersen, Thomas Lin. 2019. *ggforce: Accelerating 'ggplot2'.* R package version 0.3.1.