-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b7508ae
commit 86f9f47
Showing
49 changed files
with
963 additions
and
215 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
#' Extract guide box legend | ||
#' @description extract_guide_box_lgd() is an Extract function that extracts data from an object. Specifically, this function implements an algorithm to extract guide box legend. The function is called for its side effects and does not return a value. | ||
#' @param a.gplot PARAM_DESCRIPTION | ||
#' @return NA () | ||
#' @description extract_guide_box_lgd() is an Extract function that extracts data from an object. Specifically, this function implements an algorithm to extract guide box legend. The function returns Legend (a character vector of length one). | ||
#' @param plot_plt Plot (a plot) | ||
#' @return Legend (a character vector of length one) | ||
#' @rdname extract_guide_box_lgd | ||
#' @export | ||
#' @importFrom ggplot2 ggplot_gtable ggplot_build | ||
#' @keywords internal | ||
extract_guide_box_lgd <- function (a.gplot) | ||
extract_guide_box_lgd <- function (plot_plt) | ||
{ | ||
tmp <- ggplot2::ggplot_gtable(ggplot2::ggplot_build(a.gplot)) | ||
tmp <- ggplot2::ggplot_gtable(ggplot2::ggplot_build(plot_plt)) | ||
leg <- which(sapply(tmp$grobs, function(x) x$name) == "guide-box") | ||
legend <- tmp$grobs[[leg]] | ||
return(legend) | ||
legend_1L_chr <- tmp$grobs[[leg]] | ||
return(legend_1L_chr) | ||
} |
Oops, something went wrong.