From 1a3ca5721fe23f10cc396b20a38584dc7d5063f2 Mon Sep 17 00:00:00 2001 From: CHKim5 Date: Tue, 24 Aug 2021 16:52:51 +0900 Subject: [PATCH] X_text,Y_text added --- R/AS_boxplot.R | 22 +++++++++++++--------- R/AS_dotplot.R | 22 +++++++++++++--------- man/AS_barplot.Rd | 8 +++++++- man/AS_boxplot.Rd | 8 +++++++- man/AS_dotplot.Rd | 8 +++++++- 5 files changed, 47 insertions(+), 21 deletions(-) diff --git a/R/AS_boxplot.R b/R/AS_boxplot.R index a7f05b1..6c59617 100644 --- a/R/AS_boxplot.R +++ b/R/AS_boxplot.R @@ -12,6 +12,8 @@ #' @param width box width #' @param fig_width figure size #' @param fig_height figure size +#' @param Y_text Y axis title size +#' @param X_text X axis text size #' #' @return ggboxplot #' @export @@ -30,7 +32,9 @@ AS_boxplot<-function(data, step_increase = 0.05, width = 0.3, fig_width = NA, - fig_height = NA){ + fig_height = NA, + X_text = 10, + Y_text = 12){ {#Summary ###Plot_data_prep### ifelse(!dir.exists(file.path(getwd(), "boxplot")), dir.create(file.path(getwd(), "boxplot")), FALSE) @@ -124,8 +128,8 @@ AS_boxplot<-function(data, plot.caption=ggplot2::element_text(size=15), # caption axis.title.x=ggplot2::element_text(vjust=10, size=15), # X axis title - axis.title.y=ggplot2::element_text(size=12), # Y axis title - axis.text.x=ggplot2::element_text(size=10, + axis.title.y=ggplot2::element_text(size=Y_text), # Y axis title + axis.text.x=ggplot2::element_text(size=X_text, vjust=.5), # X axis text axis.text.y=ggplot2::element_text(size=10), legend.position = legend_position)+ @@ -162,8 +166,8 @@ AS_boxplot<-function(data, plot.caption=ggplot2::element_text(size=15), # caption axis.title.x=ggplot2::element_text(vjust=10, size=15), # X axis title - axis.title.y=ggplot2::element_text(size=12), # Y axis title - axis.text.x=ggplot2::element_text(size=10, + axis.title.y=ggplot2::element_text(size=Y_text), # Y axis title + axis.text.x=ggplot2::element_text(size=X_text, vjust=.5), # X axis text axis.text.y=ggplot2::element_text(size=10), legend.position = legend_position) @@ -241,8 +245,8 @@ AS_boxplot<-function(data, plot.caption=ggplot2::element_text(size=15), # caption axis.title.x=ggplot2::element_text(vjust=10, size=15), # X axis title - axis.title.y=ggplot2::element_text(size=12), # Y axis title - axis.text.x=ggplot2::element_text(size=10, + axis.title.y=ggplot2::element_text(size=Y_text), # Y axis title + axis.text.x=ggplot2::element_text(size=X_text, vjust=.5), # X axis text axis.text.y=ggplot2::element_text(size=10), legend.position = legend_position, @@ -275,8 +279,8 @@ AS_boxplot<-function(data, plot.caption=ggplot2::element_text(size=15), # caption axis.title.x=ggplot2::element_text(vjust=10, size=15), # X axis title - axis.title.y=ggplot2::element_text(size=12), # Y axis title - axis.text.x=ggplot2::element_text(size=10, + axis.title.y=ggplot2::element_text(size=Y_text), # Y axis title + axis.text.x=ggplot2::element_text(size=X_text, vjust=.5), # X axis text axis.text.y=ggplot2::element_text(size=10), legend.position = legend_position) diff --git a/R/AS_dotplot.R b/R/AS_dotplot.R index 29ad843..57aee63 100644 --- a/R/AS_dotplot.R +++ b/R/AS_dotplot.R @@ -12,6 +12,8 @@ #' @param size dot size #' @param fig_width figure size #' @param fig_height figure size +#' @param Y_text Y axis title size +#' @param X_text X axis text size #' #' @return ggdotplot #' @export @@ -30,7 +32,9 @@ AS_dotplot<-function(data, step_increase = 0.05, size = NULL, fig_width = NA, - fig_height = NA){ + fig_height = NA, + X_text = 10, + Y_text = 12){ {#Summary ###Plot_data_prep### ifelse(!dir.exists(file.path(getwd(), "dotplot")), dir.create(file.path(getwd(), "dotplot")), FALSE) @@ -125,8 +129,8 @@ AS_dotplot<-function(data, plot.caption=ggplot2::element_text(size=15), # caption axis.title.x=ggplot2::element_text(vjust=10, size=15), # X axis title - axis.title.y=ggplot2::element_text(size=12), # Y axis title - axis.text.x=ggplot2::element_text(size=10, + axis.title.y=ggplot2::element_text(size=Y_text), # Y axis title + axis.text.x=ggplot2::element_text(size=X_text, vjust=.5), # X axis text axis.text.y=ggplot2::element_text(size=10), legend.position = legend_position)+ @@ -164,8 +168,8 @@ AS_dotplot<-function(data, plot.caption=ggplot2::element_text(size=15), # caption axis.title.x=ggplot2::element_text(vjust=10, size=15), # X axis title - axis.title.y=ggplot2::element_text(size=12), # Y axis title - axis.text.x=ggplot2::element_text(size=10, + axis.title.y=ggplot2::element_text(size=Y_text), # Y axis title + axis.text.x=ggplot2::element_text(size=X_text, vjust=.5), # X axis text axis.text.y=ggplot2::element_text(size=10), legend.position = legend_position) @@ -243,8 +247,8 @@ AS_dotplot<-function(data, plot.caption=ggplot2::element_text(size=15), # caption axis.title.x=ggplot2::element_text(vjust=10, size=15), # X axis title - axis.title.y=ggplot2::element_text(size=12), # Y axis title - axis.text.x=ggplot2::element_text(size=10, + axis.title.y=ggplot2::element_text(size=Y_text), # Y axis title + axis.text.x=ggplot2::element_text(size=X_text, vjust=.5), # X axis text axis.text.y=ggplot2::element_text(size=10), legend.position = legend_position)+ @@ -282,8 +286,8 @@ AS_dotplot<-function(data, plot.caption=ggplot2::element_text(size=15), # caption axis.title.x=ggplot2::element_text(vjust=10, size=15), # X axis title - axis.title.y=ggplot2::element_text(size=12), # Y axis title - axis.text.x=ggplot2::element_text(size=10, + axis.title.y=ggplot2::element_text(size=Y_text), # Y axis title + axis.text.x=ggplot2::element_text(size=X_text, vjust=.5), # X axis text axis.text.y=ggplot2::element_text(size=10), legend.position = legend_position) diff --git a/man/AS_barplot.Rd b/man/AS_barplot.Rd index 8168e83..c8c383a 100644 --- a/man/AS_barplot.Rd +++ b/man/AS_barplot.Rd @@ -16,7 +16,9 @@ AS_barplot( step_increase = 0.05, width = 0.3, fig_width = NA, - fig_height = NA + fig_height = NA, + X_text = 10, + Y_text = 12 ) } \arguments{ @@ -43,6 +45,10 @@ AS_barplot( \item{fig_width}{figure size} \item{fig_height}{figure size} + +\item{X_text}{X axis text size} + +\item{Y_text}{Y axis title size} } \value{ ggbarplot diff --git a/man/AS_boxplot.Rd b/man/AS_boxplot.Rd index 26d6a41..bbf6d49 100644 --- a/man/AS_boxplot.Rd +++ b/man/AS_boxplot.Rd @@ -16,7 +16,9 @@ AS_boxplot( step_increase = 0.05, width = 0.3, fig_width = NA, - fig_height = NA + fig_height = NA, + X_text = 10, + Y_text = 12 ) } \arguments{ @@ -43,6 +45,10 @@ AS_boxplot( \item{fig_width}{figure size} \item{fig_height}{figure size} + +\item{X_text}{X axis text size} + +\item{Y_text}{Y axis title size} } \value{ ggboxplot diff --git a/man/AS_dotplot.Rd b/man/AS_dotplot.Rd index 04a96c9..51de032 100644 --- a/man/AS_dotplot.Rd +++ b/man/AS_dotplot.Rd @@ -16,7 +16,9 @@ AS_dotplot( step_increase = 0.05, size = NULL, fig_width = NA, - fig_height = NA + fig_height = NA, + X_text = 10, + Y_text = 12 ) } \arguments{ @@ -43,6 +45,10 @@ AS_dotplot( \item{fig_width}{figure size} \item{fig_height}{figure size} + +\item{X_text}{X axis text size} + +\item{Y_text}{Y axis title size} } \value{ ggdotplot