Commonly used scientific symbols in pandoc markdown
encoding is UTF-8, needs xelatex, like this:
---
output:
pdf_document:
latex_engine: xelatex
---
| #' When plotting multiple data series that share a common x axis but different y axes, | |
| #' we can just plot each graph separately. This suffers from the drawback that the shared axis will typically | |
| #' not align across graphs due to different plot margins. | |
| #' One easy solution is to reshape2::melt() the data and use ggplot2's facet_grid() mapping. However, there is | |
| #' no way to label individual y axes. | |
| #' facet_grid() and facet_wrap() were designed to plot small multiples, where both x- and y-axis ranges are | |
| #' shared acros all plots in the facetting. While the facet_ calls allow us to use different scales with | |
| #' the \code{scales = "free"} argument, they should not be used this way. | |
| #' A more robust approach is to the grid package grid.draw(), rbind() and ggplotGrob() to create a grid of | |
| #' individual plots where the plot axes are properly aligned within the grid. |
Commonly used scientific symbols in pandoc markdown
encoding is UTF-8, needs xelatex, like this:
---
output:
pdf_document:
latex_engine: xelatex
---
| #### Intended for use with the `redcapAPI` package | |
| #' @name missingSummary | |
| #' @aliases missingSummary.redcapApiConnection | |
| #' @aliases missingSummary.redcapDbConneciton | |
| #' @aliases missingSummary_offline | |
| #' @export missingSummary | |
| #' @export missingSummary.redcapApiConnection | |
| #' @export missingSummary.redcapDbConnection | |
| #' @export missingSummary_offline | |
| #' |
| #=================================================== | |
| # Demo multi-function roxygen2 - three ways to do it | |
| #=================================================== | |
| # This shows how things do work, including wierd corner cases, not | |
| # how they should be done. Most of the information comes from | |
| # http://r-pkgs.had.co.nz/man.html | |
| #==================================================== | |
| # Demo multi-function roxygen2 page using @describeIn |
| library(ggplot2) | |
| # preview a file that would be created by ggsave() | |
| ggpreview <- function(...) { | |
| fname <- tempfile(fileext = ".png") | |
| ggsave(filename = fname, ...) | |
| system2("open", fname) | |
| invisible(NULL) | |
| } |
| library(rlang) | |
| # Functions with names ending in `_impl` take quoted expressions as input. | |
| # This removes the need for constant quoting and unquoting | |
| simplify_sum_impl <- function(e1, e2) { | |
| if (is_syntactic_literal(e1) & is_syntactic_literal(e2)) { | |
| return(eval_bare(e1 + e2)) | |
| } | |
| if (e1 == 0) { |
| # Adapted from https://stackoverflow.com/a/7267364/1036500 by Andrie de Vries | |
| # This is it: theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust = 0.5)) | |
| library(ggplot2) | |
| td <- expand.grid( | |
| hjust=c(0, 0.5, 1), | |
| vjust=c(0, 0.5, 1), | |
| angle=c(0, 45, 90), |
Default ggplot2 aesthetics by geom.
| geom | alpha | angle | colour | family | fill | fontface | height | hjust | lineheight | linetype | shape | size | stroke | vjust | weight | width | xmax | xmin | ymax | ymin |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| GeomAbline | NA | black | 1 | 0.5 | ||||||||||||||||
| GeomAnnotationMap | NA | NA | grey20 | 1 | 0.5 | |||||||||||||||
| GeomArea | NA | NA | grey20 | 1 | 0.5 | |||||||||||||||
| GeomBar | NA | NA | grey35 | 1 | 0. |
| --- | |
| title: "Example Data Dictionary" | |
| author: "Jennifer Thompson" | |
| date: "11/1/2018" | |
| output: | |
| html_document: | |
| theme: yeti | |
| code_folding: hide | |
| --- |