diff --git a/Figure_8_4.png b/Figure_8_4.png deleted file mode 100644 index c9dddae..0000000 Binary files a/Figure_8_4.png and /dev/null differ diff --git a/NAMESPACE b/NAMESPACE index 9a7ed4f..ca22cf3 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -7,3 +7,4 @@ export(forest_plot) export(get_sample_data) export(run_interactiveforestplot) import(data.table, except = c(last,between,first)) +importFrom(colourpicker,colourInput) diff --git a/NEWS.md b/NEWS.md index 94e4c48..7ea72a1 100644 --- a/NEWS.md +++ b/NEWS.md @@ -6,8 +6,8 @@ * added and exported `expand_modelframe` function * added the possibility to select the shapes manually via `interval_shape` and `bsv_shape` * added capability for user to reverse color legend separately via `legend_color_reverse` -* added capability for user to specify text for legend titles via `interval_legend_title` and `shape_legend_title` as well as to control text size via `legend_title_size` -* added capability for user to specify facet text color via `x_facet_text_col` and `y_facet_text_col` +* added capability for user to specify text for legend titles via `interval_legend_title` and `shape_legend_title` as well as to control legend title text size via `legend_title_size` +* added capability for user to specify facet text color via `x_facet_text_col` and `y_facet_text_col` for improved theming support * added possibility to add different ref line(s)/area(s) by parameter via `ref_value_by_panel` and `ref_value_by_panel_data` function arguments (not in the shiny, app) diff --git a/R/forest_plot.R b/R/forest_plot.R index 3234caf..7cebe90 100644 --- a/R/forest_plot.R +++ b/R/forest_plot.R @@ -1,3 +1,6 @@ +#' @importFrom colourpicker colourInput +# ' @importFrom ggplot2 translate_shape_string not yet + # Same as base R `which()` function, but return 0 instead of an empty vector # if there are no TRUE values in the array which0 <- function(x) { @@ -290,7 +293,7 @@ label_wrap <- function(width) { #' ref_value_by_panel_data = as.data.frame( #' plotdata %>% #' distinct(paramname2,covname) %>% -#' mutate(xintercept=ifelse(paramname2=="CMAX",1,1.2)))) +#' dplyr::mutate(xintercept=ifelse(paramname2=="CMAX",1,1.2)))) #' #' # Example 3 #' @@ -314,7 +317,7 @@ label_wrap <- function(width) { #' # Example 4 #' plotdata <- get_sample_data("dataforest.csv") #' plotdata <- plotdata %>% -#' mutate(midlabel = format(round(mid,2), nsmall = 2), +#' dplyr::mutate(midlabel = format(round(mid,2), nsmall = 2), #' lowerlabel = format(round(lower,2), nsmall = 2), #' upperlabel = format(round(upper,2), nsmall = 2), #' LABEL = paste0(midlabel, " [", lowerlabel, "-", upperlabel, "]")) @@ -684,8 +687,8 @@ forest_plot <- function( inherit.aes = FALSE, )+ ggplot2::geom_ribbon( - data = ref_value_by_panel_data %>% - mutate(x= xintercept, + data = cbind(as.data.frame(ref_value_by_panel_data), + x = ref_value_by_panel_data$xintercept, ymax = Inf, ymin = -Inf, fill = area_legend_text), @@ -1240,5 +1243,3 @@ draw_key_pointrangeh <- function(data, params, size) { ) } -# ' @importFrom colourpicker colourInput -# ' @importFrom ggplot2 translate_shape_string \ No newline at end of file diff --git a/coveffectsplot_full.png b/coveffectsplot_full.png deleted file mode 100644 index 3cc158e..0000000 Binary files a/coveffectsplot_full.png and /dev/null differ diff --git a/man/forest_plot.Rd b/man/forest_plot.Rd index bf33ad0..39f86d2 100644 --- a/man/forest_plot.Rd +++ b/man/forest_plot.Rd @@ -442,7 +442,7 @@ forest_plot(plotdata, ref_value_by_panel_data = as.data.frame( plotdata \%>\% distinct(paramname2,covname) \%>\% - mutate(xintercept=ifelse(paramname2=="CMAX",1,1.2)))) + dplyr::mutate(xintercept=ifelse(paramname2=="CMAX",1,1.2)))) # Example 3 @@ -466,7 +466,7 @@ forest_plot(plotdata, # Example 4 plotdata <- get_sample_data("dataforest.csv") plotdata <- plotdata \%>\% - mutate(midlabel = format(round(mid,2), nsmall = 2), + dplyr::mutate(midlabel = format(round(mid,2), nsmall = 2), lowerlabel = format(round(lower,2), nsmall = 2), upperlabel = format(round(upper,2), nsmall = 2), LABEL = paste0(midlabel, " [", lowerlabel, "-", upperlabel, "]"))