Title: | Internal helpers |
---|---|
Description: | Floating deep down in the sea starfish lives healthy and happily. |
Authors: | Catherine Blatter [aut, cre] |
Maintainer: | Catherine Blatter <[email protected]> |
License: | CC BY 4.0 |
Version: | 0.0.9.9001 |
Built: | 2025-02-01 05:59:17 UTC |
Source: | https://github.com/cathblatter/starfish |
Reverse engineer a table from its description from a SQL query
create_table(tbl_name)
create_table(tbl_name)
tbl_name |
Table with holds the value with both the TABLE_NAME as well as the COLUMN_NAME. See details and examples |
The table to create derives its name from the TABLE_NAME column and the columns from the COLUMN_NAME column. Overall, the output comes from an Oracle DB
a tibble assigned to the GlobalEnv
# mockup table descritpion (tbl_descr <- tibble::tibble(TABLE_NAME = c("my_table"), COLUMN_NAME = c("var1", "var2", "var3"))) # now print the table ## Not run: create_table(tbl_descr)
# mockup table descritpion (tbl_descr <- tibble::tibble(TABLE_NAME = c("my_table"), COLUMN_NAME = c("var1", "var2", "var3"))) # now print the table ## Not run: create_table(tbl_descr)
dict_tbl about pep_hierarchie dataset
dict_hierarchie
dict_hierarchie
An object of class tbl_df
(inherits from tbl
, data.frame
) with 27 rows and 3 columns.
dict_tbl about pep_zeiten dataset
dict_pepzeiten
dict_pepzeiten
An object of class tbl_df
(inherits from tbl
, data.frame
) with 32 rows and 6 columns.
STARFISH customized facets with units on right side
facet_wrap_starfish( facets = ~anon_unit, ncol = 1, nrow = NULL, strip.position = "right", drop = TRUE, scales = "fixed", shrink = TRUE, labeller = "label_value", as.table = TRUE, switch = NULL, dir = "h", ... ) facet_wrap_sf( facets = ~anon_unit, ncol = 1, nrow = NULL, strip.position = "right", drop = TRUE, scales = "fixed", shrink = TRUE, labeller = "label_value", as.table = TRUE, switch = NULL, dir = "h", ... )
facet_wrap_starfish( facets = ~anon_unit, ncol = 1, nrow = NULL, strip.position = "right", drop = TRUE, scales = "fixed", shrink = TRUE, labeller = "label_value", as.table = TRUE, switch = NULL, dir = "h", ... ) facet_wrap_sf( facets = ~anon_unit, ncol = 1, nrow = NULL, strip.position = "right", drop = TRUE, scales = "fixed", shrink = TRUE, labeller = "label_value", as.table = TRUE, switch = NULL, dir = "h", ... )
facets |
defaults to variable anon_unit |
ncol |
defaults to 1 |
nrow |
defaults to NULL |
strip.position |
"right" |
drop |
default: TRUE |
scales |
default: fixed |
shrink |
default fixed |
labeller |
"label_value" |
as.table |
TRUE |
switch |
NULL |
dir |
"h" |
... |
to pass to |
a facet
Filter all shifts where a certain condition is met
filter_shifts_where(.data, ..., shift_var = shift_id)
filter_shifts_where(.data, ..., shift_var = shift_id)
.data |
a data frame or tibble |
... |
condition to pass to dplyr::filter |
shift_var |
variable with the shift_identified, default = "shift_id" |
a dataframe containing all shift-entries where a condition is met
Highlighting Covid timeframe in NH
geom_covid_starfish( date1 = "2020-03-17", date2 = "2021-12-01", color = "grey30", linetype = "dashed", alpha = 0.6 )
geom_covid_starfish( date1 = "2020-03-17", date2 = "2021-12-01", color = "grey30", linetype = "dashed", alpha = 0.6 )
date1 |
default set |
date2 |
default set |
color |
default set |
linetype |
default set |
alpha |
default set |
a custom geom
Get names of all unique palettes provided in starfish
get_starfish_palettes(full = FALSE)
get_starfish_palettes(full = FALSE)
full |
Whether to include full palette names (with suffixes, e.g. |
Vector of palette name stubs or full names
get_starfish_palettes()
get_starfish_palettes()
Custom coloring and filling functions based on unique color palettes
scale_color_starfish_d(palette = "starfish", extend = FALSE, ...) scale_colour_starfish_d(palette = "starfish", extend = FALSE, ...) scale_fill_starfish_d(palette = "starfish", extend = FALSE, ...) scale_color_starfish_op( palette = "starfish", val_names = c("good", "neutral", "bad"), ... ) scale_colour_starfish_op( palette = "starfish", val_names = c("good", "neutral", "bad"), ... ) scale_fill_starfish_op( palette = "starfish", val_names = c("good", "neutral", "bad"), ... ) scale_color_starfish_div(palette = "starfish", ...) scale_colour_starfish_div(palette = "starfish", ...) scale_fill_starfish_div(palette = "starfish", ...) scale_color_starfish_c(palette = "starfish", ...) scale_colour_starfish_c(palette = "starfish", ...) scale_fill_starfish_c(palette = "starfish", ...)
scale_color_starfish_d(palette = "starfish", extend = FALSE, ...) scale_colour_starfish_d(palette = "starfish", extend = FALSE, ...) scale_fill_starfish_d(palette = "starfish", extend = FALSE, ...) scale_color_starfish_op( palette = "starfish", val_names = c("good", "neutral", "bad"), ... ) scale_colour_starfish_op( palette = "starfish", val_names = c("good", "neutral", "bad"), ... ) scale_fill_starfish_op( palette = "starfish", val_names = c("good", "neutral", "bad"), ... ) scale_color_starfish_div(palette = "starfish", ...) scale_colour_starfish_div(palette = "starfish", ...) scale_fill_starfish_div(palette = "starfish", ...) scale_color_starfish_c(palette = "starfish", ...) scale_colour_starfish_c(palette = "starfish", ...) scale_fill_starfish_c(palette = "starfish", ...)
palette |
Name of color palette |
extend |
Whether to extend discrete color palette to make sufficient colors for levels needed |
... |
Additional arguments to be passed to internal scale function |
val_names |
For opinionated scales, defaults to "good", "neutral", "bad" |
Specific functions include:
scale_(color/colour/fill)_starfish_d
: Discrete palette with either fixed or dynamically extended number of shades
scale_(color/colour/fill)_starfish_op
\b
: Discrete palette with fixed colors for "good", "bad", and "neutral"
scale_(color/colour/fill)_starfish_div
: Continuous diverging color palette, must contain negative, neutral, positive values
scale_(color/colour/fill)_starfish_c
: Continuous color palette
library(ggplot2) library(starfish) ggplot(diamonds[1:2000,], aes(x = cut, y = carat, color = cut)) + geom_point() + scale_color_starfish_d() + theme_starfish()
library(ggplot2) library(starfish) ggplot(diamonds[1:2000,], aes(x = cut, y = carat, color = cut)) + geom_point() + scale_color_starfish_d() + theme_starfish()
Custom starfish date scale
scale_x_date_starfish( date_breaks = "1 year", date_labels = "%Y", expand = c(0.05, 0), ... ) scale_x_date_sf( date_breaks = "1 year", date_labels = "%Y", expand = c(0.05, 0), ... )
scale_x_date_starfish( date_breaks = "1 year", date_labels = "%Y", expand = c(0.05, 0), ... ) scale_x_date_sf( date_breaks = "1 year", date_labels = "%Y", expand = c(0.05, 0), ... )
date_breaks |
defaults to 1 year |
date_labels |
defaults to YYYY |
expand |
how to expand the axes |
... |
further args passed |
a custom scale
STARFISH palette with six dimensions
starfish_pal starfish_pal_op starfish_pal_cont starfish_pal_div
starfish_pal starfish_pal_op starfish_pal_cont starfish_pal_div
An object of class character
of length 17.
An object of class character
of length 3.
An object of class character
of length 2.
An object of class character
of length 3.
a table containing all days of the study period
as dates
as integer representation
days in month
weekdays
months
weekends
tbl_study_period
tbl_study_period
An object of class data.frame
with 1826 rows and 5 columns.
ggplot2 plot theme based on...
theme_starfish(base_theme = ggplot2::theme_minimal(), ...)
theme_starfish(base_theme = ggplot2::theme_minimal(), ...)
base_theme |
A base theme upon which additional theme-specific options are applied |
... |
Fruther arguments passed to |
https://github.com/gadenbuie/ggpomological/blob/master/R/theme_pomological.R
## Not run: library(ggplot2) data <- data.frame(x = 1:10, y = 1:10) ggplot(data, aes(x, y)) + geom_point() + theme_starfish() ## End(Not run)
## Not run: library(ggplot2) data <- data.frame(x = 1:10, y = 1:10) ggplot(data, aes(x, y)) + geom_point() + theme_starfish() ## End(Not run)
paths to the project directory - data folder
wd_data_rd
wd_data_rd
An object of class character
of length 1.
paths to the project directory - de-id'd data folder
wd_deidata_rd
wd_deidata_rd
An object of class character
of length 1.
paths to the project directory - prepared data folder
wd_prepdata_rd
wd_prepdata_rd
An object of class character
of length 1.
paths to the project directory - prepared data folder
wd_procdata_rd
wd_procdata_rd
An object of class character
of length 1.
paths to the project directory
wd_rd
wd_rd
An object of class character
of length 1.