Commit 3cdc5ad1 authored by Jalbert, Joe's avatar Jalbert, Joe
Browse files

Removed Multiplot to fix bug in function creation

parent 580311a4
......@@ -15,4 +15,5 @@ Imports:
openxlsx,
officer,
flextable,
grid
grid,
dbplyr
......@@ -5,7 +5,7 @@ export(FitFlextableToPage)
export(SISTable)
export(appendInteraction)
export(document)
export(multiplot)
export(edwFinance)
export(pairwise)
export(pairwiseReport)
export(report)
......@@ -14,8 +14,6 @@ export(simplifyAppend)
export(wbsave)
import(dbplyr)
import(flextable)
import(grid)
import(lazyeval)
import(officer)
import(openxlsx)
import(tidyverse)
......
......@@ -182,58 +182,11 @@ appendInteraction=function(report,df, Measures,Factor,Interaction, Simplify=T){
}
}
#' Plotting more than one plot together
#'
#' @param ... Name of each plot
#' @param plotlist A vector with plot names
#' @param cols How many columns of plots you want in your chart
#' @param layout A matrix specifying the layout. If present, 'cols' is ignored.
#'
#' @return
#' @import grid
#' @export
#'
#' @examples
multiplot <- function(..., plotlist=NULL, cols=1, layout=NULL) {
library(grid)
# Make a list from the ... arguments and plotlist
plots <- c(list(...), plotlist)
numPlots = length(plots)
# If layout is NULL, then use 'cols' to determine layout
if (is.null(layout)) {
# Make the panel
# ncol: Number of columns of plots
# nrow: Number of rows needed, calculated from # of cols
layout <- matrix(seq(1, cols * ceiling(numPlots/cols)),
ncol = cols, nrow = ceiling(numPlots/cols))
}
if (numPlots==1) {
print(plots[[1]])
} else {
# Set up the page
grid.newpage()
pushViewport(viewport(layout = grid.layout(nrow(layout), ncol(layout))))
# Make each plot, in the correct location
for (i in 1:numPlots) {
# Get the i,j matrix positions of the regions that contain this subplot
matchidx <- as.data.frame(which(layout == i, arr.ind = TRUE))
print(plots[[i]], vp = viewport(layout.pos.row = matchidx$row,
layout.pos.col = matchidx$col))
}
}
}
#' Force Flextable to Page
#'
#' @param ft Flextable object
#' @param pgwidth Customizable page width setting
#' @param pgwidth Customization page width setting
#'
#' @return
#' @import flextable
......@@ -519,7 +472,7 @@ SISTable=function(TABLENAME){
#' @return
#' @import tidyverse
#' @import dbplyr
#' @export
#' @export
#'
#' @examples
edwFinance=function(TableName, DB=EDW){
......
......@@ -9,7 +9,7 @@ FitFlextableToPage(ft, pgwidth = 6)
\arguments{
\item{ft}{Flextable object}
\item{pgwidth}{Customizable page width setting}
\item{pgwidth}{Customization page width setting}
}
\value{
......
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/JoeToolFunctions.R
\name{edwFinance}
\alias{edwFinance}
\title{Pulling Finance EDW Tables}
\usage{
edwFinance(TableName, DB = EDW)
}
\arguments{
\item{TableName}{String. Name of the Table to be pulled.}
\item{DB}{Reference to the connection. Defaults to EDW}
}
\value{
}
\description{
Pulling Finance EDW Tables
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/JoeToolFunctions.R
\name{multiplot}
\alias{multiplot}
\title{Plotting more than one plot together}
\usage{
multiplot(..., plotlist = NULL, cols = 1, layout = NULL)
}
\arguments{
\item{...}{Name of each plot}
\item{plotlist}{A vector with plot names}
\item{cols}{How many columns of plots you want in your chart}
\item{layout}{A matrix specifying the layout. If present, 'cols' is ignored.}
}
\value{
}
\description{
Plotting more than one plot together
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment