install.packages(c("tidyverse","reprex","ggplot2"))
#> Installing packages into '/Users/arphatak/Library/R/3.5/library'
#> (as 'lib' is unspecified)
#>
#> The downloaded binary packages are in
#> /var/folders/p5/vpnvn_w93xj0pfnhcf7mnl58rqftqf/T//RtmpXBVFuS/downloaded_packages
library(tidyverse)
library(reprex)
library(ggplot2)
ggplot(mpg, aes(displ,hwy, colour = class)) + geom_point()

svg(filename = "100218_reprex", width = 6, height = 6, pointsize = 2)
#> Warning in svg(filename = "100218_reprex", width = 6, height = 6, pointsize = 2): unable to load shared object '/Library/Frameworks/R.framework/Resources/library/grDevices/libs//cairo.so':
#> dlopen(/Library/Frameworks/R.framework/Resources/library/grDevices/libs//cairo.so, 6): Library not loaded: /opt/X11/lib/libcairo.2.dylib
#> Referenced from: /Library/Frameworks/R.framework/Resources/library/grDevices/libs//cairo.so
#> Reason: image not found
#> Warning in svg(filename = "100218_reprex", width = 6, height = 6, pointsize
#> = 2): failed to load cairo DLL
capabilities("cairo")
#> cairo
#> TRUE
sessionInfo()
#> R version 3.5.1 (2018-07-02)
#> Platform: x86_64-apple-darwin15.6.0 (64-bit)
#> Running under: macOS High Sierra 10.13.6
#>
#> Matrix products: default
#> BLAS: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRblas.0.dylib
#> LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib
#>
#> locale:
#> [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
#>
#> attached base packages:
#> [1] stats graphics grDevices utils datasets methods base
#>
#> other attached packages:
#> [1] reprex_0.2.1 forcats_0.3.0 stringr_1.3.1 dplyr_0.7.6
#> [5] purrr_0.2.5 readr_1.1.1 tidyr_0.8.1 tibble_1.4.2
#> [9] ggplot2_3.0.0 tidyverse_1.2.1
#>
#> loaded via a namespace (and not attached):
#> [1] Rcpp_0.12.19 cellranger_1.1.0 pillar_1.3.0 compiler_3.5.1
#> [5] plyr_1.8.4 bindr_0.1.1 tools_3.5.1 digest_0.6.17
#> [9] lubridate_1.7.4 jsonlite_1.5 evaluate_0.11 nlme_3.1-137
#> [13] gtable_0.2.0 lattice_0.20-35 pkgconfig_2.0.2 rlang_0.2.2
#> [17] cli_1.0.1 yaml_2.2.0 haven_1.1.2 bindrcpp_0.2.2
#> [21] withr_2.1.2 xml2_1.2.0 httr_1.3.1 knitr_1.20
#> [25] fs_1.2.6 hms_0.4.2 rprojroot_1.3-2 grid_3.5.1
#> [29] tidyselect_0.2.4 glue_1.3.0 R6_2.2.2 readxl_1.1.0
#> [33] rmarkdown_1.10 modelr_0.1.2 magrittr_1.5 backports_1.1.2
#> [37] scales_1.0.0 htmltools_0.3.6 rvest_0.3.2 assertthat_0.2.0
#> [41] colorspace_1.3-2 labeling_0.3 stringi_1.2.4 lazyeval_0.2.1
#> [45] munsell_0.5.0 broom_0.5.0 crayon_1.3.4
reprex::reprex(input = "100218_RStudio_svg-help.R", outfile = "100218_RStudio_svg-help.md")
Created on 2018-10-02 by the reprex package (v0.2.1)