-
Notifications
You must be signed in to change notification settings - Fork 1
/
extending_default_behavior.Rmd
93 lines (77 loc) · 5.6 KB
/
extending_default_behavior.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
87
88
89
90
---
title: "Extending the Default Behavior"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{extending behavior}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```
Greetings and welcome to `{gvsu215}`!
I've tried to keep function names simple and required arguments to a minimum to help students focus on the statistical content rather than the R code. That being said, there are some more advanced features and capabilities built into the package that you as the instructor may take advantage of if you so choose.
# Different R Markdown Export Formats
This package should be able to be used in any output format using R Markdown, including HTML^[1], PDF^[2], and Word. If this is not the case, [reach out to Dr. John Gabrosek](mailto:gabrosej@gvsu.edu) or [submit an issue on GitHub](https://github.com/ian-curtis/gvsu215/issues).
^[1]: Best results will come from HTML output.
^[2]: If using PDF output, you will want to make sure student R Markdown files have the following in the YAML header which will allow the compiler to use the `xelatex` engine. As such, you will avoid messages printing out from every function call.
```
output:
pdf_document:
latex_engine: xelatex
```
# Extra Function Arguments
Many functions in this package have extra arguments that aren't necessary for basic function features but can allow for a little customization depending on your pedagogical approach and preferences, such as if you are focusing on data literacy or proper axis labeling. Each of the functions listed below have extra arguments, which are detailed after the function name.
* `tbl_1var()`, `tbl_corr()`, `tbl_num_sum()`
* The `digits` argument can be specified with an integer value for the number of digits to round to. Defaults to 3.
* The `caption` argument can be used to override the default caption.
* The `with_prop` argument (defaults to "no") can be set to "yes" to replace the percent column with the corresponding proportions.
* The `na_rm` argument can be used to remove missing values from the table
* `tbl_2var()`
* The `row_pct` argument can be used to add in row percentages in each cell.
* The `digits` argument can be specified with an integer value for the number of digits to round to. Defaults to 3.
* The `caption` argument can be used to override the default caption.
* The `na_rm` argument can be used to remove missing values from the table
* `tbl_pctile()`
* The `probs` argument can be used to specify which percentiles are to be given. Simply pass in a vector of values between 0 and 1.
* The `digits` argument can be specified with an integer value for the number of digits to round to. Defaults to 3.
* The `caption` argument can be used to override the default caption.
* `plot_bar()`
* The `type` argument can be used to specify if a plot with `percent`s or `count`s is desired.
* The `fill` argument can be used to choose a fill color (for a single variable plot).
* The `orient` argument can be used to flip the axis. Choose either "vertical" (the default) or "horizontal".
* The `dodge` argument can be used to create more rows on the x-axis labels. This can help if your labels are overlapping. Use an integer to tell how many row to create (more than 2 is not recommended for interpretability).
* The `title` argument can be used to override the default title.
* The `...` is used for other labels on the plot, namely, the x- and y-axis labels.
* `plot_box()`
* The `fill` argument can be used to choose a fill color.
* The `breaks` argument can be used to specify x-axis breaks. Use `seq(start, stop, jump)`.
* The `orient` argument can be used to flip the axis. Choose either "vertical" (the default) or "horizontal".
* The `title` argument can be used to override the default title.
* The `...` is used for other labels on the plot, namely, the x- and y-axis labels.
* `plot_hist()`
* The `group_cols` argument can be used with a grouped histogram to specify how many columns the faceted output should take up.
* The `fill` argument can be used to choose a fill color.
* The `breaks` can be used to specify how the x-axis labels should be broken. Use `seq(_START_, _STOP_, _JUMP_)`. Accuracy is not guaranteed.
* The `title` argument can be used to override the default title.
* The `...` is used for other labels on the plot, namely, the x- and y-axis labels.
* `plot_scatter()`
* The `fill` argument can be used to choose a fill color (for a non-grouped plot).
* The `title` argument can be used to override the default title.
* The `legend_title` argument can be used to override the default legend title.
* The `axis_lines` argument can be used to draw axis gridlines on the plot (`both`).
* The `ls_line` argument can be set to `TRUE` to draw in a least squares line.
* The `...` is used for other labels on the plot, namely, the x- and y-axis labels.
* `infer_*()`
* The `digits` argument can be specified with an integer value for the number of digits to round to. Defaults to 3.
* The `caption` argument can be used to override the default caption.
* The `conf_lvl` argument can be used to choose a different confidence level other than 0.95. (Not applicable to `infer_anova()`.)
* `infer_1mean_test()` and `infer_paired()`
* The `mu0` argument can be used to specify the null hypothesis value, if different from 0.
* `infer_1prop_test()`
* The `p0` argument can be used to specify the null hypothesis value, if different from 0.5.
* `inter_2prop_test()`
* This is an extra function should you be interested. It does not appear in the student cheatsheet.