Skip to content

Commit

Permalink
Merge pull request #77 from gforge/develop
Browse files Browse the repository at this point in the history
Minor CRAN updates
  • Loading branch information
gforge authored Jun 23, 2020
2 parents 10a3152 + f64cdaf commit 875dd7b
Show file tree
Hide file tree
Showing 18 changed files with 403 additions and 274 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ S3method(txtRound,table)
export(addHtmlTableStyle)
export(concatHtmlTables)
export(getHtmlTableTheme)
export(hasHtmlTableStyle)
export(htmlTable)
export(htmlTableWidget)
export(htmlTableWidgetOutput)
Expand Down
552 changes: 318 additions & 234 deletions R/htmlTable.R

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions R/htmlTable_helpers_mergeClr.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' Merges multiple colors
#'
#' Uses the \code{\link[grDevices]{colorRampPalette}} for merging colors.
#' Uses the \code{\link[grDevices:colorRamp]{colorRampPalette}} for merging colors.
#' \emph{Note:} When merging more than 2 colors the order in the color
#' presentation matters. Each color is merged with its neigbors before
#' merging with next. If there is an uneven number of colors the middle
Expand Down Expand Up @@ -33,4 +33,4 @@ prMergeClr <- function(clrs) {
left <- prMergeClr(left)
right <- prMergeClr(right)
return(prMergeClr(c(left, right)))
}
}
22 changes: 22 additions & 0 deletions R/htmlTable_style_handlers.R
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,28 @@ appendHtmlTableStyle <- function(x,
return(x)
}

#' Check if object has a style set to it
#'
#' If the attribute \code{htmlTable.style} is set it will check if
#' the \code{style_name} exists and return a \code{logical}.
#'
#' @param x The object intended for \code{\link{htmlTable}}.
#' @param style_name A string that contains the style name.
#' @return \code{logical} \code{TRUE} if the attribute and style is not \code{NULL}
#' @export
hasHtmlTableStyle <- function(x, style_name) {
style <- attr(x, style_attribute_name, exact = TRUE)
if (is.null(style)) {
return(FALSE)
}

if (is.null(style[[style_name]])) {
return(FALSE)
}

return(TRUE)
}

style_attribute_name <- "htmlTable.style"

prValidateAndMergeStyles <- function(org_style_list, styles_from_arguments, overwrite) {
Expand Down
2 changes: 1 addition & 1 deletion R/htmlTable_theme.R
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ prGetArgumentList <- function(args, skip_elements) {

#' Retrieve the \code{\link{htmlTable}} theme list
#'
#' A wrapper for a \code{\link[base]{getOption}("htmlTable.theme")} call that
#' A wrapper for a \code{\link[base:options]{getOption}("htmlTable.theme")} call that
#' returns the standard theme unless one is set.
#'
#' @return \code{list} with the styles to be applied to the table
Expand Down
20 changes: 11 additions & 9 deletions R/tidyHtmlTable.R
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,20 @@
#'
#' @section Simple tibble output:
#'
#' The tibble discourages the use of row names. There is therefore a convenience
#' option for \code{tidyHtmlTable} where you can use the function just as you
#' would with \code{\link{htmlTable}} where \code{rnames} is populated with
#' the \code{rnames} argument provided using \code{tidyselect} syntax (defaults to
#' the "names" column if present int the input data).
#' The tibble discourages the use of row names. There is therefore a convenience
#' option for \code{tidyHtmlTable} where you can use the function just as you
#' would with \code{\link{htmlTable}} where \code{rnames} is populated with
#' the \code{rnames} argument provided using \code{tidyselect} syntax (defaults to
#' the "names" column if present int the input data).
#'
#' @section Additional dependencies:
#'
#' In order to run this function you also must have \code{\link[dplyr]{dplyr}},
#' \code{\link[tidyr]{tidyr}}, \code{\link[tidyselect]{tidyselect}} and
#' \code{\link[purrr]{purrr}} packages installed. These have been removed due to
#' the additional 20 Mb that these dependencies added (issue #47).
#' In order to run this function you also must have \pkg{dplyr},
#' \pkg{tidyr}, \pkg{tidyselect} and \pkg{purrr}
#' packages installed. These have been removed due to
#' the additional 20 Mb that these dependencies added (issue #47).
#' \emph{Note:} if you use \pkg{tidyverse} it will already have
#' all of these and you do not need to worry.
#'
#' @param x Tidy data used to build the \code{htmlTable}
#' @param value The column containing values filling individual cells of the
Expand Down
4 changes: 1 addition & 3 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
Fix for R 4.0

## Test environments
* Ubuntu install, R 3.6.1
* Ubuntu install, R 4.0.1
* Winbuilder

## R CMD check results
Expand Down
2 changes: 1 addition & 1 deletion man/getHtmlTableTheme.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions man/hasHtmlTableStyle.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/htmlTable.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/prGetCgroupHeader.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/prGetRgroupLine.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/prGetThead.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/prMergeClr.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/prPrepareAlign.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/prPrepareCss.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/prSkipRownames.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 11 additions & 9 deletions man/tidyHtmlTable.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 875dd7b

Please sign in to comment.