Skip to content

Commit

Permalink
Merge pull request #205 from DeclareDesign/rename
Browse files Browse the repository at this point in the history
Rename inside vignettes too
  • Loading branch information
jaspercooper committed Oct 29, 2018
2 parents 5c605a1 + 7068aa5 commit 23a0299
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions vignettes/How_to_Write_and_Contribute_Designers.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ First, install the development version of **DesignLibrary** in `R`:
devtools::install_github("DeclareDesign/DesignLibrary", keep_source = TRUE)
```

A designer is a function that returns designs. For example, `simple_two_arm_designer()` generates simple two-arm designs as `DeclareDesign` objects.
A designer is a function that returns designs. For example, `two_arm_designer()` generates simple two-arm designs as `DeclareDesign` objects.

In addition to using our pre-made designers, you can contribute your own designers to the `DesignLibrary`, using the following guidelines.

Expand Down Expand Up @@ -214,7 +214,7 @@ Next, list and describe all arguments needed in the design code following the sy
You can also add keywords and reference other related designs and designers.
```{r, eval=FALSE}
#' @concept two arm design
#' @seealso \code{\link{my_design}} \code{\link{simple_two_arm_designer}}
#' @seealso \code{\link{my_design}} \code{\link{two_arm_designer}}
```

Finally, give yourself credit for your work.
Expand Down
14 changes: 7 additions & 7 deletions vignettes/simple_two_arm.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ How does this design work? One way to think about it is to compare the random as
We subtract the mean of the control group from the mean of the treatment group in order to estimate the average treatment effect.


```{r, code = get_design_code(simple_two_arm_designer()), eval=TRUE}
```{r, code = get_design_code(two_arm_designer()), eval=TRUE}
```


```{r}
diagnosis <- diagnose_design(simple_two_arm_design)
diagnosis <- diagnose_design(two_arm_design)
```

```{r,eval = TRUE, echo = FALSE}
Expand All @@ -57,22 +57,22 @@ kable(reshape_diagnosis(diagnosis)[,-c(1,2,3,5)], digits = 2)

## Using the Simple Two Arm Designer

In R, you can generate a simple two arm design using the template function `simple_two_arm_designer()` in the `DesignLibrary` package by running the following lines, which load the package:
In R, you can generate a simple two arm design using the template function `two_arm_designer()` in the `DesignLibrary` package by running the following lines, which load the package:

```{r, eval=FALSE}
library(DesignLibrary)
```

We can then create specific designs by defining values for each argument. For example, we can create a design called `my_simple_two_arm_design` where `N`, `prob`, and `ate` set to 500, .5, and .4, respectively, and other parameters use default values. To do so, we run the lines below.
We can then create specific designs by defining values for each argument. For example, we can create a design called `my_two_arm_design` where `N`, `prob`, and `ate` set to 500, .5, and .4, respectively, and other parameters use default values. To do so, we run the lines below.

```{r, eval=FALSE}
simple_two_arm_design <- simple_two_arm_designer(N = 500, prob = .5, ate = .4)
two_arm_design <- two_arm_designer(N = 500, prob = .5, ate = .4)
```

You can see more details on the `simple_two_arm_designer()` function, its arguments, and default values, by running the following line of code:
You can see more details on the `two_arm_designer()` function, its arguments, and default values, by running the following line of code:

```{r, eval=FALSE}
??simple_two_arm_designer
??two_arm_designer
```


Expand Down

0 comments on commit 23a0299

Please sign in to comment.