Skip to content

Commit

Permalink
fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
flxzimmer committed Aug 7, 2023
1 parent 82fa628 commit 836f671
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions R/plot.designresult.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
#' Plot a one- or two-dimensional graph of the result.
#'
#' @param design Specify a design as a list. Can be used to make a 1D plot for a two-dimensional simfun. Set NA for the dimension that should be plotted and set a value for all others. For example: design=list(n=NA,k=9)
#' @param adderrorbars logical. Plots errorbars in the 1D plot if TRUE. Default is FALSE (also if specified as NULL).
#' @param adderrorbars logical. Plots error bars in the 1D plot if TRUE. Default is FALSE (also if specified as NULL).
#' @param addribbon logical. Adds ribbon in the 1D plot if TRUE. Default is TRUE (also if specified as NULL).
#' @param trim logical. Option to trim the plotting area for the 2D line plot. The trimmed area is the area where the line is plotted. Default is TRUE.
#' @param type character indicating the type of the 2D plot. Can be 'heat'(default) or 'line'.
#' @param color.gradient character indicating whether the 2D plot should have a "diverging" color gradient (white-blue-white, default) or a "linear" color gradient (blue-red)
#' @param color.width numeric. Option for the diverging colormap in the 2D plot. Width of the blue-white colorband.
#' @param color.width numeric. Option for the diverging color map in the 2D plot. Width of the blue-white color band.
#' @param x Object of class designresult as created by the find.design function.
#' @param ... additional arguments to be passed.
#'
Expand Down
4 changes: 2 additions & 2 deletions R/plot2d_heat.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ plot2d_heat <- function(ds,color.width,color.gradient) {
names(powerfit) <- c("n", "k")
powerfit$power <- apply(powerfit, 1, fit$fitfun)

# control colorband width (only for diverging)
# control color band width (only for diverging)
if (color.gradient == "diverging") {
dist = color.width/2
toofar <- abs(powerfit$power - final$power) > dist
powerfit$power[toofar] <- NA
}

# control colorband width (only for linear)
# control color band width (only for linear)
if (color.gradient == "linear") {
dist = .3
toofar <- abs(powerfit$power - final$power) > dist
Expand Down
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ This is a basic demonstration to the mlpwr package by going through a toy exampl
The package can be loaded via

```{r}
library(mlpwr)
library(mlpwr)
```


Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ We can perform the search with the above arguments in use.
``` r
ds <- find.design(simfun = simfun_ttest, boundaries = c(100,
300), power = 0.95, evaluations = 4000)
#> Updates: 1, Evaluations: 1000, Time: 0.2 Updates: 2, Evaluations: 1200, Time: 0.3 Updates: 3, Evaluations: 1400, Time: 0.4 Updates: 4, Evaluations: 1600, Time: 0.4 Updates: 5, Evaluations: 1800, Time: 0.5 Updates: 6, Evaluations: 2000, Time: 0.6 Updates: 7, Evaluations: 2200, Time: 0.7 Updates: 8, Evaluations: 2400, Time: 0.8 Updates: 9, Evaluations: 2600, Time: 0.8 Updates: 10, Evaluations: 2800, Time: 0.9 Updates: 11, Evaluations: 3000, Time: 0.9 Updates: 12, Evaluations: 3200, Time: 1 Updates: 13, Evaluations: 3400, Time: 1.1 Updates: 14, Evaluations: 3600, Time: 1.1 Updates: 15, Evaluations: 3800, Time: 1.2 Updates: 16, Evaluations: 4000, Time: 1.3
#> Updates: 1, Evaluations: 1000, Time: 0.2 Updates: 2, Evaluations: 1200, Time: 0.2 Updates: 3, Evaluations: 1400, Time: 0.3 Updates: 4, Evaluations: 1600, Time: 0.4 Updates: 5, Evaluations: 1800, Time: 0.5 Updates: 6, Evaluations: 2000, Time: 0.5 Updates: 7, Evaluations: 2200, Time: 0.6 Updates: 8, Evaluations: 2400, Time: 0.6 Updates: 9, Evaluations: 2600, Time: 0.7 Updates: 10, Evaluations: 2800, Time: 0.8 Updates: 11, Evaluations: 3000, Time: 0.8 Updates: 12, Evaluations: 3200, Time: 0.9 Updates: 13, Evaluations: 3400, Time: 0.9 Updates: 14, Evaluations: 3600, Time: 1 Updates: 15, Evaluations: 3800, Time: 1.1 Updates: 16, Evaluations: 4000, Time: 1.1
```

While it is running, the function gives us some updates regarding the
Expand All @@ -117,7 +117,7 @@ summary(ds)
#> Design: N = 201
#>
#> Power: 0.95064, SE: 0.00379
#> Evaluations: 4000, Time: 1.47, Updates: 16
#> Evaluations: 4000, Time: 1.23, Updates: 16
#> Surrogate: Logistic regression
```

Expand Down
2 changes: 1 addition & 1 deletion vignettes/extensions.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ aggregate_fun(a)
```


# Inhomogenous Cost Functions
# Inhomogeneous Cost Functions

Some uses cases feature more complex cost functions. We cover an example here. It builds on the "ANOVA" simulation function in the "simulation_functions" vignette.

Expand Down

0 comments on commit 836f671

Please sign in to comment.