cleanup tests and build
Gitea Organization/civilyticsR/pipeline/head There was a failure building this commit
Gitea Organization/civilyticsR/pipeline/head There was a failure building this commit
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
#' @importFrom jpeg readJPEG
|
||||
#' @importFrom graphics rasterImage
|
||||
#' @examples
|
||||
#' img <- system.file("img","Civilytics Consulting Logo.jpg",package="civilytics")
|
||||
#' img <- system.file("img","civilytics_logo.jpg",package="civilytics")
|
||||
#' plot_jpeg(img)
|
||||
plot_jpeg <- function(path, add=FALSE, upscale = TRUE)
|
||||
{
|
||||
@@ -30,13 +30,10 @@ plot_jpeg <- function(path, add=FALSE, upscale = TRUE)
|
||||
#'
|
||||
#' @param filename a character with file path to a png file
|
||||
#'
|
||||
#' @return
|
||||
#' @return a plotted rasteGrob of a png image
|
||||
#' @export
|
||||
#' @importFrom png readPNG
|
||||
#' @importFrom grid rasterGrob
|
||||
#'
|
||||
#' @examples
|
||||
#'
|
||||
get_png <- function(filename) {
|
||||
grid::rasterGrob(png::readPNG(filename), interpolate = TRUE)
|
||||
}
|
||||
@@ -48,12 +45,10 @@ get_png <- function(filename) {
|
||||
#' @param logo a logo grob created by make_logo_grob()
|
||||
#' @param margin_param a numeric specifying what margin to add or subtract to align the logo
|
||||
#'
|
||||
#' @return
|
||||
#' @return a grob with a logo attached to it ready to plot
|
||||
#' @importFrom ggplot2 theme
|
||||
#' @importFrom gridExtra arrangeGrob
|
||||
#' @export
|
||||
#'
|
||||
#' @examples
|
||||
add_logo <- function(plot, logo, margin_param = NULL) {
|
||||
if(has_caption(plot)) {
|
||||
# convert the caption size to a negative number and on the "pt" scale
|
||||
@@ -118,7 +113,7 @@ has_caption <- function(gg) {
|
||||
#' @param widths an optional vector the same length as plot_list with the widths for each plot
|
||||
#' @param margin_param a number giving the adjustment up or down to help manually align logo and captions
|
||||
#'
|
||||
#' @return
|
||||
#' @return a grid object
|
||||
#' @note The resulting object needs to be drawn to the screen using grid.draw()
|
||||
#' @importFrom gridExtra arrangeGrob
|
||||
#' @importFrom ggplot2 theme
|
||||
|
||||
Reference in New Issue
Block a user