Skip to content

Commit c261d4c

Browse files
committed
Clean up on documentation and tests
1 parent 6ce7969 commit c261d4c

File tree

9 files changed

+22
-6
lines changed

9 files changed

+22
-6
lines changed

DESCRIPTION

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ Imports:
1919
stats,
2020
utils,
2121
tools,
22-
parallel
22+
parallel,
23+
htmltools
2324
Suggests:
2425
testthat,
2526
covr,

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import(data.table)
2929
import(ggplot2)
3030
import(gridExtra)
3131
import(rmarkdown)
32+
importFrom(htmltools,tagList)
3233
importFrom(networkD3,diagonalNetwork)
3334
importFrom(networkD3,radialNetwork)
3435
importFrom(parallel,detectCores)

R/plot.R

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ plotDataExplorer <- function(plot_obj, title, ggtheme, theme_config, plotly = FA
3838
#' @param title plot title
3939
#' @param ggtheme complete ggplot2 themes
4040
#' @param theme_config a list of configurations to be passed to \link[ggplot2]{theme}
41+
#' @param plotly if \code{TRUE}, convert ggplot to interactive plotly object (requires the \pkg{plotly} package). Default is \code{FALSE}.
4142
#' @param page_layout a list of page indices with associated plot indices
4243
#' @param nrow number of rows per page
4344
#' @param ncol number of columns per page
@@ -49,7 +50,7 @@ plotDataExplorer <- function(plot_obj, title, ggtheme, theme_config, plotly = FA
4950
#' @import gridExtra
5051
#' @export
5152
#' @seealso \link{plotDataExplorer} \link{plotDataExplorer.single} \link{plotDataExplorer.multiple}
52-
plotDataExplorer.grid <- function(plot_obj, title, ggtheme, theme_config, page_layout, nrow, ncol, plotly = FALSE, ...) {
53+
plotDataExplorer.grid <- function(plot_obj, title, ggtheme, theme_config, plotly = FALSE, page_layout, nrow, ncol, ...) {
5354
plot_list <- lapply(plot_obj, function(p) {
5455
p +
5556
eval(ggtheme) +
@@ -98,6 +99,7 @@ plotDataExplorer.grid <- function(plot_obj, title, ggtheme, theme_config, page_l
9899
#' @param title plot title
99100
#' @param ggtheme complete ggplot2 themes
100101
#' @param theme_config a list of configurations to be passed to \link[ggplot2]{theme}
102+
#' @param plotly if \code{TRUE}, convert ggplot to interactive plotly object (requires the \pkg{plotly} package). Default is \code{FALSE}.
101103
#' @param \dots other arguments to be passed
102104
#' @return invisibly return the ggplot object
103105
#' @keywords internal
@@ -133,6 +135,7 @@ plotDataExplorer.single <- function(plot_obj, title, ggtheme, theme_config, plot
133135
#' @param title plot title
134136
#' @param ggtheme complete ggplot2 themes
135137
#' @param theme_config a list of configurations to be passed to \link[ggplot2]{theme}
138+
#' @param plotly if \code{TRUE}, convert ggplot to interactive plotly object (requires the \pkg{plotly} package). Default is \code{FALSE}.
136139
#' @param \dots other arguments to be passed
137140
#' @return invisibly return the named list of ggplot objects
138141
#' @keywords internal
@@ -141,7 +144,7 @@ plotDataExplorer.single <- function(plot_obj, title, ggtheme, theme_config, plot
141144
#' @importFrom stats setNames
142145
#' @export
143146
#' @seealso \link{plotDataExplorer} \link{plotDataExplorer.grid} \link{plotDataExplorer.single}
144-
plotDataExplorer.multiple <- function(plot_obj, title, ggtheme, theme_config, page_layout, facet_wrap_args = list(), plotly = FALSE, ...) {
147+
plotDataExplorer.multiple <- function(plot_obj, title, ggtheme, theme_config, plotly = FALSE, page_layout, facet_wrap_args = list(), ...) {
145148
n <- length(page_layout)
146149
plot_list <- lapply(setNames(seq.int(n), paste0("page_", seq.int(n))), function(i) {
147150
plot_obj[[i]] +

R/plot_bar.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@
3636
#' plot_bar(diamonds, by = "cut")
3737
#' plot_bar(diamonds, by = "cut", by_position = "dodge")
3838
#'
39+
#' \dontrun{
3940
#' # Interactive plotly version (requires the plotly package)
4041
#' # plot_bar(diamonds, plotly = TRUE)
42+
#' }
4143

4244
plot_bar <- function(data, with = NULL,
4345
by = NULL, by_position = "fill",

R/plot_prcomp.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#' @import ggplot2
2525
#' @importFrom scales percent
2626
#' @importFrom stats prcomp
27+
#' @importFrom htmltools tagList
2728
#' @export
2829
#' @examples
2930
#' plot_prcomp(na.omit(airquality), nrow = 2L, ncol = 2L)
@@ -123,7 +124,7 @@ plot_prcomp <- function(data,
123124
"scales" = "free_x"
124125
)
125126
)
126-
return(htmltools::tagList(out1, out2))
127+
return(tagList(out1, out2))
127128
}
128129
invisible(c(
129130
list(

man/plotDataExplorer.grid.Rd

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/plotDataExplorer.multiple.Rd

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/plotDataExplorer.single.Rd

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/plot_bar.Rd

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)