-
Notifications
You must be signed in to change notification settings - Fork 0
/
MyPackage.Rmd
86 lines (66 loc) · 2.18 KB
/
MyPackage.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
---
title: "MyPackage"
author: "Sarah Palacios"
date: "12/4/2020"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
install.packages("devtools")
install.packages("roxygen2")
library(devtools)
library(roxygen2)
library(ggplot2)
```
```{r, eval = FALSE}
setwd("./bestcolorgraphs")
```
```{r}
theme_purple <- function() {
theme(panel.border = element_rect(color = "purple", fill = NA, linetype = 2),
panel.background = element_rect(fill = "lavenderblush"),
axis.text = element_text(color = "purple4", face = "italic", family = "Georgia", size = 9),
axis.title = element_text(color = "purple4", face = "bold", family = "Georgia", size = 10),
plot.title = element_text(color = "purple4", face = "bold", family = "Georgia", size = 12, margin = margin(b = 10, t = 5)),
legend.title = element_text(color = "purple4", face = "bold", family = "Georgia", size = 9),
legend.text = element_text(color = "purple4", family = "Georgia", size = 8))
}
theme_blue <- function() {
theme(panel.border = element_rect(color = "royalblue", fill = NA, linetype = 2),
panel.background = element_rect(fill = "slategray1"),
axis.text = element_text(color = "royalblue4", face = "italic", family = "Georgia", size = 9),
axis.title = element_text(color = "royalblue4", face = "bold", family = "Georgia", size = 10),
plot.title = element_text(color = "royalblue4", face = "bold", family = "Georgia", size = 12, margin = margin(b = 10, t = 5)),
legend.title = element_text(color = "royalblue4", face = "bold", family = "Georgia", size = 9),
legend.text = element_text(color = "royalblue4", family = "Georgia", size = 8))
}
```
```{r, eval = FALSE}
use_r("theme_purple")
use_r("theme_blue")
```
```{txt}
#' Purple theme for ggplot2
#'
#' This is a complete theme which controls all non-data display.
#'
#' @param ... arguments passed to function
#' @rdname theme_purple
#' @export
#' Blue theme for ggplot2
#'
#' This is a complete theme which controls all non-data display.
#'
#' @param ... arguments passed to function
#' @rdname theme_purple
#' @export
```
```{r document-theme_purple, eval = FALSE}
document()
```
```{r document-theme_blue, eval = FALSE}
document()
```
```{r}
?theme_purple
```