Skip to contents

ggplot2

Themes

theme_cs() set_x_axis_vertical()
ggplot2 theme
pretty_breaks()
Pretty breaks
every_nth()
Returns every nth discrete value

Colors

scale_color_cs()
Main colour extractor https://drsimonj.svbtle.com/creating-corporate-colour-palettes-for-ggplot2
scale_fill_cs()
Main colour extractor https://drsimonj.svbtle.com/creating-corporate-colour-palettes-for-ggplot2
colors
Colors
display_all_palettes()
Main colour extractor https://drsimonj.svbtle.com/creating-corporate-colour-palettes-for-ggplot2

Plots

Utils

save_a4()
Save ggplot in A4 scale

Styles/Formatting

Format

format_cstidy_age_as_factor() format_cstidy_age_as_character()
Formats a cstidy age as a factor
format_date_as_nor() format_datetime_as_nor() format_datetime_as_file()
Format date in the Norwegian format
format_location_code_as_factor() format_location_code_as_character()
Makes a factor with a label from a vector of location codes
format_num_as_nor_invlog10_1() format_num_as_nor_invlog10_2()
Formats as a norwegian number with 1 digit on log-10 scale. Useful for scale labels
format_num_as_nor_invlog2_1() format_num_as_nor_invlog2_2()
Formats as a norwegian number with 1 digit on log-2 scale. Useful for scale labels
format_num_as_nor_invloge_1() format_num_as_nor_invloge_2()
Formats as a norwegian number with 1 digit on log scale. Useful for scale labels
format_num_as_nor_num_0() format_num_as_nor_num_1() format_num_as_nor_num_2()
Formats as a norwegian number with 0 digits. Useful for scale labels
format_num_as_nor_per100k_0() format_num_as_nor_per100k_1() format_num_as_nor_per100k_2()
Formats as a norwegian number with 0 digits and the suffix " /100k". Useful for scale labels
format_num_as_nor_perc_0() format_num_as_nor_perc_1() format_num_as_nor_perc_2()
Formats as a norwegian number with 0 digits and puts a Useful for scale labels

Github

as_github_code()
An easy way to print github code
print(<github_code>)
Print github_code

Other

view_html()
View HTML in the rstudio view
set_global()
set_global