This package containts functions that I often use.
devtools::install_github("tonyelhabr/temisc")
.
Here is a list of all functions in the package.
#> [1] "add_logo" "add_tickmarks"
#> [3] "add_yyyymm_cols" "add_yyyymmdd_cols"
#> [5] "colors_te" "compute_rank"
#> [7] "compute_summary" "convert_fmla_to_char"
#> [9] "create_fmla" "create_kable"
#> [11] "create_kable_html" "get_color_hex"
#> [13] "get_color_hex_inverse" "get_dates_colnames"
#> [15] "get_filepath" "get_month_lastday"
#> [17] "get_yyyymm" "get_yyyymmdd"
#> [19] "html_te" "list_file_details_cleanly"
#> [21] "normalize_path_te" "repeat_df"
#> [23] "standardize_z" "theme_te"
#> [25] "theme_te_a" "theme_te_a_dx"
#> [27] "theme_te_a_facet" "theme_te_a_facet_dx"
#> [29] "theme_te_b" "theme_te_b_dx"
#> [31] "theme_te_b_facet" "theme_te_b_facet_dx"
#> [33] "theme_te_dx" "theme_te_facet"
#> [35] "theme_te_facet_dx" "unitize"
Here are some examples of the plotting functions.
library("ggplot2")
viz_labs <-
labs(title = "A Title.",
subtitle = "A subtitle.",
caption = "A caption.")
viz_cars <-
ggplot(mtcars, aes(x = wt, y = mpg, color = factor(gear))) +
geom_point(size = 2) +
geom_smooth(method = "lm", se = FALSE, size = 2) +
viz_labs
viz_cars_facet <-
viz_cars +
facet_wrap(~ am, scales = "free")
viz_diamonds <-
ggplot(diamonds, aes(x = clarity, fill = cut)) +
geom_bar() +
scale_fill_manual(values = scales::hue_pal()(5)) +
viz_labs
viz_diamonds_facet <-
viz_diamonds +
facet_wrap(~ cut, scales = "free")
# viz_iris <-
# ggplot(iris, aes(x = Species, y = Sepal.Length, fill = Species)) +
# geom_col() +
# viz_labs
# viz_cars + theme_grey()
viz_cars + theme_te()
# viz_cars + theme_te(option = "b")
# viz_cars_facet + theme_grey()
viz_cars_facet + theme_te_facet()
# viz_cars_facet + theme_te_facet(option = "b")
# viz_diamonds + theme_grey()
viz_diamonds + theme_te_dx()
# viz_diamonds_facet + theme_grey()
viz_diamonds_facet + theme_te_facet_dx()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.