├── .Rbuildignore ├── .gitignore ├── DESCRIPTION ├── NAMESPACE ├── R ├── ggframe.R └── zz.R ├── README.Rmd ├── README.md ├── ggframe.Rproj └── man ├── as_ggplot.Rd ├── facet.Rd ├── figures ├── README-unnamed-chunk-2-1.png ├── README-unnamed-chunk-2-2.png ├── README-unnamed-chunk-2-3.png ├── README-unnamed-chunk-2-4.png └── README-unnamed-chunk-3-1.png ├── geom.Rd ├── map_aes.Rd ├── print.ggframe.Rd ├── set_coord.Rd ├── set_guide.Rd ├── set_labs.Rd ├── set_scale.Rd └── set_theme.Rd /.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^ggframe\.Rproj$ 2 | ^\.Rproj\.user$ 3 | ^README\.Rmd$ 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .Rproj.user 2 | .Rhistory 3 | .RData 4 | -------------------------------------------------------------------------------- /DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: ggframe 2 | Title: data frames that print as ggplots 3 | Version: 0.0.0.9000 4 | Authors@R: 5 | person(given = "Antoine", 6 | family = "Fabri", 7 | role = c("aut", "cre"), 8 | email = "antoine.fabri@gmail.com") 9 | Description: data frames that print as ggplots. 10 | License: GPL-3 11 | Encoding: UTF-8 12 | Language: en 13 | LazyData: true 14 | Roxygen: list(markdown = TRUE) 15 | RoxygenNote: 7.1.1 16 | Imports: 17 | ggplot2, 18 | tibble 19 | URL: https://github.com/moodymudskipper/ggframe 20 | BugReports: https://github.com/moodymudskipper/ggframe/issues 21 | -------------------------------------------------------------------------------- /NAMESPACE: -------------------------------------------------------------------------------- 1 | # Generated by roxygen2: do not edit by hand 2 | 3 | S3method(print,ggframe) 4 | export(as_ggplot) 5 | export(facet) 6 | export(geom) 7 | export(map_aes) 8 | export(set_coord) 9 | export(set_guide) 10 | export(set_labs) 11 | export(set_scale) 12 | export(set_theme) 13 | -------------------------------------------------------------------------------- /R/ggframe.R: -------------------------------------------------------------------------------- 1 | as_ggframe <- function(x) { 2 | class(x) <- union("ggframe", class(x)) 3 | x 4 | } 5 | 6 | #' Map aesthetics 7 | #' 8 | #' @param .data data 9 | #' @param x x 10 | #' @param y y 11 | #' @param ... ... 12 | #' @export 13 | map_aes <- function(.data, x, y, ...) { 14 | attr(.data, "aes") <- eval(substitute(alist(x = x, y = y, ...))) 15 | as_ggframe(.data) 16 | } 17 | 18 | #' print a ggframe 19 | #' 20 | #' @param x x 21 | #' @param plot whether to plot or print data.frame and attributes 22 | #' @param ... for compatibility with other methods 23 | #' 24 | #' @export 25 | print.ggframe <- function(x, plot = TRUE, ...) { 26 | if(!plot) { 27 | writeLines("# A ggframe") 28 | aes <- attr(x, "aes") 29 | aes <- paste0(names(aes), "=", aes, collapse = ", ") 30 | writeLines(paste0("# aes: ", aes)) 31 | layers <- sapply(attr(x, "layers"), deparse1) 32 | 33 | if(length(layers)) { 34 | writeLines(paste0("# layers:\n", paste("#", layers, collapse = "\n"))) 35 | } 36 | print(tibble::as_tibble(x)) 37 | return(invisible(x)) 38 | } 39 | plt <- as_ggplot(x) 40 | print(plt) 41 | invisible(x) 42 | } 43 | 44 | 45 | #' Convert ggframe to ggplot 46 | #' 47 | #' @param x ggframe object 48 | #' 49 | #' @export 50 | as_ggplot <- function(x) { 51 | aes_call <- as.call(c(quote(ggplot2::aes), attr(x, "aes"))) 52 | ggplot_call <- as.call(c(quote(ggplot2::ggplot), quote(x), aes_call)) 53 | plt <- eval(ggplot_call) + lapply(attr(x, "layers"), eval) 54 | plt 55 | } 56 | 57 | #' Add a geom 58 | #' 59 | #' @param .data data.frame or ggframe 60 | #' @param geom a string so that `geom_` will be called 61 | #' @param ... passed to `geom_()` 62 | #' 63 | #' @export 64 | geom <- function(.data, geom, ...) { 65 | geom <- as.symbol(paste0("geom_", geom)) 66 | if(is.null(attr(.data, "layers"))) attr(.data, "layers") <- list() 67 | attr(.data, "layers") <- append(attr(.data, "layers"), substitute(geom(...))) 68 | as_ggframe(.data) 69 | } 70 | 71 | 72 | #' facet 73 | #' 74 | #' @param .data data.frame or ggframe 75 | #' @param facet a string so that `facet_` will be called 76 | #' @param ... passed to `facet_()` 77 | #' 78 | #' @export 79 | facet <- function(.data, facet, ...) { 80 | facet <- as.symbol(paste0("facet_", facet)) 81 | if(is.null(attr(.data, "layers"))) attr(.data, "layers") <- list() 82 | attr(.data, "layers") <- append(attr(.data, "layers"), substitute(facet(...))) 83 | as_ggframe(.data) 84 | } 85 | 86 | 87 | #' set theme 88 | #' 89 | #' @param .data data.frame or ggframe 90 | #' @param theme a string so that `theme_` will be called 91 | #' @param ... passed to `theme_()` 92 | #' 93 | #' @export 94 | set_theme <- function(.data, theme, ...) { 95 | if(is.null(attr(.data, "layers"))) attr(.data, "layers") <- list() 96 | if(!missing(theme)) { 97 | theme <- as.symbol(paste0("theme_", theme)) 98 | attr(.data, "layers") <- append(attr(.data, "layers"), substitute(theme(...))) 99 | } else { 100 | attr(.data, "layers") <- 101 | append(attr(.data, "layers"), as.call( 102 | c(quote(ggplot2::theme), eval(substitute(alist(...)))))) 103 | } 104 | as_ggframe(.data) 105 | } 106 | 107 | 108 | 109 | #' set coord 110 | #' 111 | #' @param .data data.frame or ggframe 112 | #' @param coord a string so that `coord_` will be called 113 | #' @param ... passed to `coord_()` 114 | #' 115 | #' @export 116 | set_coord <- function(.data, coord, ...) { 117 | coord <- as.symbol(paste0("coord_", coord)) 118 | if(is.null(attr(.data, "layers"))) attr(.data, "layers") <- list() 119 | attr(.data, "layers") <- append(attr(.data, "layers"), substitute(coord(...))) 120 | as_ggframe(.data) 121 | } 122 | 123 | #' set scale 124 | #' 125 | #' @param .data data.frame or ggframe 126 | #' @param scale a string so that `scale_` will be called 127 | #' @param ... passed to `scale_()` 128 | #' 129 | #' @export 130 | set_scale <- function(.data, scale, ...) { 131 | scale <- as.symbol(paste0("scale_", scale)) 132 | if(is.null(attr(.data, "layers"))) attr(.data, "layers") <- list() 133 | attr(.data, "layers") <- append(attr(.data, "layers"), substitute(scale(...))) 134 | as_ggframe(.data) 135 | } 136 | 137 | #' set guide 138 | #' 139 | #' @param .data data.frame or ggframe 140 | #' @param guide a string so that `guide_` will be called 141 | #' @param ... passed to `guide_()` 142 | #' 143 | #' @export 144 | set_guide <- function(.data, guide, ...) { 145 | guide <- as.symbol(paste0("guide_", guide)) 146 | if(is.null(attr(.data, "layers"))) attr(.data, "layers") <- list() 147 | attr(.data, "layers") <- append(attr(.data, "layers"), substitute(guide(...))) 148 | as_ggframe(.data) 149 | } 150 | 151 | #' set labs 152 | #' 153 | #' @param .data data.frame or ggframe 154 | #' @inheritParams ggplot2::labs 155 | #' 156 | #' @export 157 | set_labs <- function(.data, ... , title = ggplot2::waiver(), subtitle = ggplot2::waiver(), caption = ggplot2::waiver(), 158 | tag = ggplot2::waiver()) { 159 | if(is.null(attr(.data, "layers"))) attr(.data, "layers") <- list() 160 | sc <- sys.call() 161 | sc[[1]] <- quote(labs) 162 | sc[[2]] <- NULL 163 | attr(.data, "layers") <- append(attr(.data, "layers"), sc) 164 | as_ggframe(.data) 165 | } 166 | 167 | ggplot_build.ggframe <- function(plot) { 168 | ggplot2::ggplot_build(as_ggplot(plot)) 169 | } 170 | -------------------------------------------------------------------------------- /R/zz.R: -------------------------------------------------------------------------------- 1 | .onAttach <- function(libname, pkgname) { 2 | if("package:ggplot2" %in% search()) 3 | .S3method("ggplot_build", class = "ggframe", method = ggplot_build.ggframe) 4 | else 5 | setHook(packageEvent("ggplot2", "attach"), function(...) 6 | .S3method("ggplot_build", class = "ggframe", method = ggplot_build.ggframe)) 7 | } 8 | 9 | -------------------------------------------------------------------------------- /README.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | output: github_document 3 | --- 4 | 5 | 6 | 7 | ```{r, include = FALSE} 8 | knitr::opts_chunk$set( 9 | collapse = TRUE, 10 | comment = "#>", 11 | fig.path = "man/figures/README-", 12 | out.width = "100%" 13 | ) 14 | ``` 15 | 16 | # ggframe 17 | 18 | *{ggframe}* is a *{ggplot2}* wrapper. A "ggframe" object is a data.frame with 19 | a "layers" and an "aes" attributes. It has a printing method which plots 20 | by default, but print with `plot = FALSE` and you'll print the data, aesthetics 21 | and layers. 22 | 23 | You cannot do all you can do with *{ggplot2}*, it's just an exploration of some 24 | ideas. Unlikely to go much further. 25 | 26 | Some nice things that you can do more easily than in native *{ggplot2}* : 27 | 28 | * data wrangling on plot data (assuming you use functions that don't drop attributes, 29 | it seems *{dplyr}* functions don't, base R functions often do) 30 | * keep track of the steps that built the plot. 31 | 32 | ## Installation 33 | 34 | Install with: 35 | 36 | ``` r 37 | remotes::install_github("moodymudskipper/ggframe") 38 | ``` 39 | ## Functions 40 | 41 | `map_aes()` sets an `aes` attribute. 42 | 43 | `geom()`, `facet()`, `set_labs`, `set_coord()`, `set_theme()`, `set_scale()` 44 | and `set_guide()` are quick and dirty wrappers that 45 | add the relevant plot building call to the `layer` attribute, 46 | I suppose a more serious version of the package would provide a wrapper for all 47 | relevant *{ggplot2}* functions, with explicit arguments rather than just `...`. 48 | One advantage here is that it works with other packages extending *{ggplot2}*. 49 | 50 | `as_ggplot()` converts a ggframe object to a standard ggplot object. 51 | 52 | ## Examples 53 | 54 | ```{r} 55 | library(dplyr, warn.conflicts = FALSE) 56 | library(ggplot2) # needs to be attached, geoms etc can come from other packages too 57 | library(ggframe) 58 | 59 | # fast to type for a quick plot 60 | iris %>% 61 | geom("point", aes(Petal.Length, Petal.Width, color = Species)) 62 | 63 | # defining default aes 64 | iris %>% 65 | map_aes(Petal.Length, Petal.Width, color = Species) %>% 66 | geom("point") 67 | 68 | # wrangle the data after the layer definitions 69 | iris %>% 70 | map_aes(Petal.Length, Petal.Width, color = Species) %>% 71 | geom("point") %>% 72 | filter(Species != "versicolor") 73 | 74 | # print data, aesthetics and layers 75 | iris %>% 76 | map_aes(Petal.Length, Petal.Width, color = Species) %>% 77 | geom("point") %>% 78 | slice_sample(n = 15) %>% 79 | print(plot = FALSE) 80 | 81 | # use set_* functions to leverage other features 82 | iris %>% 83 | map_aes(Petal.Length, Petal.Width, color = Species) %>% 84 | geom("point") %>% 85 | set_coord("fixed") %>% 86 | set_theme("classic") %>% 87 | set_scale("color_viridis_d") %>% 88 | set_labs(title = "hello") 89 | ``` 90 | 91 | In *{ggplot2}* the `ggplot()` functions takes as optional arguments the data and aesthetics 92 | to be inherited by further layers. It doesn't link explicitly aesthetics to a datasets 93 | (you can define aesthetics to be inherited, but use a different dataset for every layer) 94 | but it's quite rare to start without a default data layer nor default aesthetics. 95 | 96 | Moreover when providing custom data for a layer, in my experience we generally don't 97 | provide completely new data, but a transformation of the main data. Indeed the `data` 98 | argument of geoms can be a function or formula to be applied on the main data. 99 | 100 | It works quite nicely here: 101 | 102 | ```{r} 103 | iris %>% 104 | map_aes(Petal.Length, Petal.Width) %>% 105 | geom("point", data = head, color = "blue") %>% 106 | geom("point", data = tail, color = "red") 107 | ``` 108 | 109 | Thanks to the fact that `ggplot2::ggplot_build()` is generic and called by 110 | `layer_data()`, `layer_scales()` and `layer_grob()`, we could make those 111 | work directly on ggframe objects : 112 | 113 | ```{r} 114 | # leverage layer_data easily 115 | iris %>% 116 | map_aes(Petal.Length, Petal.Width) %>% 117 | geom("point", data = head, color = "blue") %>% 118 | geom("point", data = tail, color = "red") %>% 119 | layer_data(2) 120 | ``` 121 | 122 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | # ggframe 5 | 6 | *{ggframe}* is a *{ggplot2}* wrapper. A “ggframe” object is a data.frame 7 | with a “layers” and an “aes” attributes. It has a printing method which 8 | plots by default, but print with `plot = FALSE` and you’ll print the 9 | data, aesthetics and layers. 10 | 11 | You cannot do all you can do with *{ggplot2}*, it’s just an exploration 12 | of some ideas. Unlikely to go much further. 13 | 14 | Some nice things that you can do more easily than in native *{ggplot2}* 15 | : 16 | 17 | - data wrangling on plot data (assuming you use functions that don’t 18 | drop attributes, it seems *{dplyr}* functions don’t, base R 19 | functions often do) 20 | - keep track of the steps that built the plot. 21 | 22 | ## Installation 23 | 24 | Install with: 25 | 26 | ``` r 27 | remotes::install_github("moodymudskipper/ggframe") 28 | ``` 29 | 30 | ## Functions 31 | 32 | `map_aes()` sets an `aes` attribute. 33 | 34 | `geom()`, `facet()`, `set_labs`, `set_coord()`, `set_theme()`, 35 | `set_scale()` and `set_guide()` are quick and dirty wrappers that add 36 | the relevant plot building call to the `layer` attribute, I suppose a 37 | more serious version of the package would provide a wrapper for all 38 | relevant *{ggplot2}* functions, with explicit arguments rather than just 39 | `...`. One advantage here is that it works with other packages extending 40 | *{ggplot2}*. 41 | 42 | `as_ggplot()` converts a ggframe object to a standard ggplot object. 43 | 44 | ## Examples 45 | 46 | ``` r 47 | library(dplyr, warn.conflicts = FALSE) 48 | library(ggplot2) # needs to be attached, geoms etc can come from other packages too 49 | library(ggframe) 50 | 51 | # fast to type for a quick plot 52 | iris %>% 53 | geom("point", aes(Petal.Length, Petal.Width, color = Species)) 54 | ``` 55 | 56 | 57 | 58 | ``` r 59 | 60 | # defining default aes 61 | iris %>% 62 | map_aes(Petal.Length, Petal.Width, color = Species) %>% 63 | geom("point") 64 | ``` 65 | 66 | 67 | 68 | ``` r 69 | 70 | # wrangle the data after the layer definitions 71 | iris %>% 72 | map_aes(Petal.Length, Petal.Width, color = Species) %>% 73 | geom("point") %>% 74 | filter(Species != "versicolor") 75 | ``` 76 | 77 | 78 | 79 | ``` r 80 | 81 | # print data, aesthetics and layers 82 | iris %>% 83 | map_aes(Petal.Length, Petal.Width, color = Species) %>% 84 | geom("point") %>% 85 | slice_sample(n = 15) %>% 86 | print(plot = FALSE) 87 | #> # A ggframe 88 | #> # aes: x=Petal.Length, y=Petal.Width, color=Species 89 | #> # layers: 90 | #> # geom_point() 91 | #> # A tibble: 15 x 5 92 | #> Sepal.Length Sepal.Width Petal.Length Petal.Width Species 93 | #> 94 | #> 1 7.4 2.8 6.1 1.9 virginica 95 | #> 2 5.7 2.8 4.1 1.3 versicolor 96 | #> 3 5.8 2.8 5.1 2.4 virginica 97 | #> 4 5.7 4.4 1.5 0.4 setosa 98 | #> 5 7.9 3.8 6.4 2 virginica 99 | #> 6 5.2 4.1 1.5 0.1 setosa 100 | #> 7 5.4 3.7 1.5 0.2 setosa 101 | #> 8 5.5 2.5 4 1.3 versicolor 102 | #> 9 6.9 3.1 5.1 2.3 virginica 103 | #> 10 4.8 3 1.4 0.3 setosa 104 | #> 11 5.9 3.2 4.8 1.8 versicolor 105 | #> 12 5.8 2.6 4 1.2 versicolor 106 | #> 13 5.6 2.8 4.9 2 virginica 107 | #> 14 6.3 3.3 4.7 1.6 versicolor 108 | #> 15 6.4 2.7 5.3 1.9 virginica 109 | 110 | # use set_* functions to leverage other features 111 | iris %>% 112 | map_aes(Petal.Length, Petal.Width, color = Species) %>% 113 | geom("point") %>% 114 | set_coord("fixed") %>% 115 | set_theme("classic") %>% 116 | set_scale("color_viridis_d") %>% 117 | set_labs(title = "hello") 118 | ``` 119 | 120 | 121 | 122 | In *{ggplot2}* the `ggplot()` functions takes as optional arguments the 123 | data and aesthetics to be inherited by further layers. It doesn’t link 124 | explicitly aesthetics to a datasets (you can define aesthetics to be 125 | inherited, but use a different dataset for every layer) but it’s quite 126 | rare to start without a default data layer nor default aesthetics. 127 | 128 | Moreover when providing custom data for a layer, in my experience we 129 | generally don’t provide completely new data, but a transformation of the 130 | main data. Indeed the `data` argument of geoms can be a function or 131 | formula to be applied on the main data. 132 | 133 | It works quite nicely here: 134 | 135 | ``` r 136 | iris %>% 137 | map_aes(Petal.Length, Petal.Width) %>% 138 | geom("point", data = head, color = "blue") %>% 139 | geom("point", data = tail, color = "red") 140 | ``` 141 | 142 | 143 | 144 | Thanks to the fact that `ggplot2::ggplot_build()` is generic and called 145 | by `layer_data()`, `layer_scales()` and `layer_grob()`, we could make 146 | those work directly on ggframe objects : 147 | 148 | ``` r 149 | # leverage layer_data easily 150 | iris %>% 151 | map_aes(Petal.Length, Petal.Width) %>% 152 | geom("point", data = head, color = "blue") %>% 153 | geom("point", data = tail, color = "red") %>% 154 | layer_data(2) 155 | #> x y PANEL group shape colour size fill alpha stroke 156 | #> 1 5.7 2.5 1 -1 19 red 1.5 NA NA 0.5 157 | #> 2 5.2 2.3 1 -1 19 red 1.5 NA NA 0.5 158 | #> 3 5.0 1.9 1 -1 19 red 1.5 NA NA 0.5 159 | #> 4 5.2 2.0 1 -1 19 red 1.5 NA NA 0.5 160 | #> 5 5.4 2.3 1 -1 19 red 1.5 NA NA 0.5 161 | #> 6 5.1 1.8 1 -1 19 red 1.5 NA NA 0.5 162 | ``` 163 | -------------------------------------------------------------------------------- /ggframe.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: No 4 | SaveWorkspace: No 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: Sweave 13 | LaTeX: pdfLaTeX 14 | 15 | AutoAppendNewline: Yes 16 | StripTrailingWhitespace: Yes 17 | LineEndingConversion: Posix 18 | 19 | BuildType: Package 20 | PackageUseDevtools: Yes 21 | PackageInstallArgs: --no-multiarch --with-keep.source 22 | PackageRoxygenize: rd,collate,namespace 23 | -------------------------------------------------------------------------------- /man/as_ggplot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ggframe.R 3 | \name{as_ggplot} 4 | \alias{as_ggplot} 5 | \title{Convert ggframe to ggplot} 6 | \usage{ 7 | as_ggplot(x) 8 | } 9 | \arguments{ 10 | \item{x}{ggframe object} 11 | } 12 | \description{ 13 | Convert ggframe to ggplot 14 | } 15 | -------------------------------------------------------------------------------- /man/facet.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ggframe.R 3 | \name{facet} 4 | \alias{facet} 5 | \title{facet} 6 | \usage{ 7 | facet(.data, facet, ...) 8 | } 9 | \arguments{ 10 | \item{.data}{data.frame or ggframe} 11 | 12 | \item{facet}{a string so that \verb{facet_} will be called} 13 | 14 | \item{...}{passed to \verb{facet_()}} 15 | } 16 | \description{ 17 | facet 18 | } 19 | -------------------------------------------------------------------------------- /man/figures/README-unnamed-chunk-2-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moodymudskipper/ggframe/a14498f3fee3ec589473404a76a25b5e17de3d3d/man/figures/README-unnamed-chunk-2-1.png -------------------------------------------------------------------------------- /man/figures/README-unnamed-chunk-2-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moodymudskipper/ggframe/a14498f3fee3ec589473404a76a25b5e17de3d3d/man/figures/README-unnamed-chunk-2-2.png -------------------------------------------------------------------------------- /man/figures/README-unnamed-chunk-2-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moodymudskipper/ggframe/a14498f3fee3ec589473404a76a25b5e17de3d3d/man/figures/README-unnamed-chunk-2-3.png -------------------------------------------------------------------------------- /man/figures/README-unnamed-chunk-2-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moodymudskipper/ggframe/a14498f3fee3ec589473404a76a25b5e17de3d3d/man/figures/README-unnamed-chunk-2-4.png -------------------------------------------------------------------------------- /man/figures/README-unnamed-chunk-3-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moodymudskipper/ggframe/a14498f3fee3ec589473404a76a25b5e17de3d3d/man/figures/README-unnamed-chunk-3-1.png -------------------------------------------------------------------------------- /man/geom.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ggframe.R 3 | \name{geom} 4 | \alias{geom} 5 | \title{Add a geom} 6 | \usage{ 7 | geom(.data, geom, ...) 8 | } 9 | \arguments{ 10 | \item{.data}{data.frame or ggframe} 11 | 12 | \item{geom}{a string so that \verb{geom_} will be called} 13 | 14 | \item{...}{passed to \verb{geom_()}} 15 | } 16 | \description{ 17 | Add a geom 18 | } 19 | -------------------------------------------------------------------------------- /man/map_aes.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ggframe.R 3 | \name{map_aes} 4 | \alias{map_aes} 5 | \title{Map aesthetics} 6 | \usage{ 7 | map_aes(.data, x, y, ...) 8 | } 9 | \arguments{ 10 | \item{.data}{data} 11 | 12 | \item{x}{x} 13 | 14 | \item{y}{y} 15 | 16 | \item{...}{...} 17 | } 18 | \description{ 19 | Map aesthetics 20 | } 21 | -------------------------------------------------------------------------------- /man/print.ggframe.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ggframe.R 3 | \name{print.ggframe} 4 | \alias{print.ggframe} 5 | \title{print a ggframe} 6 | \usage{ 7 | \method{print}{ggframe}(x, plot = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{x}{x} 11 | 12 | \item{plot}{whether to plot or print data.frame and attributes} 13 | 14 | \item{...}{for compatibility with other methods} 15 | } 16 | \description{ 17 | print a ggframe 18 | } 19 | -------------------------------------------------------------------------------- /man/set_coord.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ggframe.R 3 | \name{set_coord} 4 | \alias{set_coord} 5 | \title{set coord} 6 | \usage{ 7 | set_coord(.data, coord, ...) 8 | } 9 | \arguments{ 10 | \item{.data}{data.frame or ggframe} 11 | 12 | \item{coord}{a string so that \verb{coord_} will be called} 13 | 14 | \item{...}{passed to \verb{coord_()}} 15 | } 16 | \description{ 17 | set coord 18 | } 19 | -------------------------------------------------------------------------------- /man/set_guide.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ggframe.R 3 | \name{set_guide} 4 | \alias{set_guide} 5 | \title{set guide} 6 | \usage{ 7 | set_guide(.data, guide, ...) 8 | } 9 | \arguments{ 10 | \item{.data}{data.frame or ggframe} 11 | 12 | \item{guide}{a string so that \verb{guide_} will be called} 13 | 14 | \item{...}{passed to \verb{guide_()}} 15 | } 16 | \description{ 17 | set guide 18 | } 19 | -------------------------------------------------------------------------------- /man/set_labs.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ggframe.R 3 | \name{set_labs} 4 | \alias{set_labs} 5 | \title{set labs} 6 | \usage{ 7 | set_labs( 8 | .data, 9 | ..., 10 | title = ggplot2::waiver(), 11 | subtitle = ggplot2::waiver(), 12 | caption = ggplot2::waiver(), 13 | tag = ggplot2::waiver() 14 | ) 15 | } 16 | \arguments{ 17 | \item{.data}{data.frame or ggframe} 18 | 19 | \item{...}{A list of new name-value pairs. The name should be an aesthetic.} 20 | 21 | \item{title}{The text for the title.} 22 | 23 | \item{subtitle}{The text for the subtitle for the plot which will be 24 | displayed below the title.} 25 | 26 | \item{caption}{The text for the caption which will be displayed in the 27 | bottom-right of the plot by default.} 28 | 29 | \item{tag}{The text for the tag label which will be displayed at the 30 | top-left of the plot by default.} 31 | } 32 | \description{ 33 | set labs 34 | } 35 | -------------------------------------------------------------------------------- /man/set_scale.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ggframe.R 3 | \name{set_scale} 4 | \alias{set_scale} 5 | \title{set scale} 6 | \usage{ 7 | set_scale(.data, scale, ...) 8 | } 9 | \arguments{ 10 | \item{.data}{data.frame or ggframe} 11 | 12 | \item{scale}{a string so that \verb{scale_} will be called} 13 | 14 | \item{...}{passed to \verb{scale_()}} 15 | } 16 | \description{ 17 | set scale 18 | } 19 | -------------------------------------------------------------------------------- /man/set_theme.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ggframe.R 3 | \name{set_theme} 4 | \alias{set_theme} 5 | \title{set theme} 6 | \usage{ 7 | set_theme(.data, theme, ...) 8 | } 9 | \arguments{ 10 | \item{.data}{data.frame or ggframe} 11 | 12 | \item{theme}{a string so that \verb{theme_} will be called} 13 | 14 | \item{...}{passed to \verb{theme_()}} 15 | } 16 | \description{ 17 | set theme 18 | } 19 | --------------------------------------------------------------------------------