#' oblicza zmienne wywodzone z już wcześniej policzonych
#' @param dane ramki danych wygenerowane wewnątrz pomocą funkcji
#' \code{\link{agreguj_do_miesiecy}} lub \code{\link{agreguj_do_okresu}}
#' @return data.frame wyliczone zmienne
#' @import dplyr
oblicz_zmienne_pochodne = function(dane){
dane = dane %>%
mutate_(
nm_bd = ~coalesce(nm_bd_n, 0L) + coalesce(nm_bd_s, 0L),
nm_d = ~coalesce(nm_d_n, 0L) + coalesce(nm_d_s, 0L),
nm_e = ~coalesce(nm_e_n, 0L) + coalesce(nm_e_s, 0L),
nm_i = ~coalesce(nm_i_n, 0L) + coalesce(nm_i_s, 0L),
nm_ii = ~coalesce(nm_ii_n, 0L) + coalesce(nm_ii_s, 0L),
nm_j = ~coalesce(nm_j_n, 0L) + coalesce(nm_j_s, 0L),
nm_m = ~coalesce(nm_m_n, 0L) + coalesce(nm_m_s, 0L),
nm_n = ~coalesce(nm_n_n, 0L) + coalesce(nm_n_s, 0L),
nm_p = ~coalesce(nm_p_n, 0L) + coalesce(nm_p_s, 0L),
nm_pnd = ~coalesce(nm_pnd_n, 0L) + coalesce(nm_pnd_s, 0L),
nm_s = ~coalesce(nm_s_n, 0L) + coalesce(nm_s_s, 0L),
nm_z = ~coalesce(nm_z_n, 0L) + coalesce(nm_z_s, 0L),
sz_e = ~coalesce(sz_e_n, 0) + coalesce(sz_e_s, 0),
sz_n = ~coalesce(sz_n_n, 0) + coalesce(sz_n_s, 0),
sz_p = ~coalesce(sz_p_n, 0) + coalesce(sz_p_s, 0),
sz_s = ~coalesce(sz_s_n, 0) + coalesce(sz_s_s, 0),
sz_x = ~coalesce(sz_x_n, 0) + coalesce(sz_x_s, 0),
sz_z = ~coalesce(sz_z_n, 0) + coalesce(sz_z_s, 0)
) %>%
mutate_(
epm_e = ~coalesce(npm_e / nm_e, NA_real_),
epm_e_n = ~coalesce(npm_e_n / nm_e_n, NA_real_),
epm_e_s = ~coalesce(npm_e_s / nm_e_s, NA_real_),
if_b = ~as.integer(nm_b > 0L),
if_b2 = ~as.integer(nm_b2 > 0L),
if_d = ~as.integer(nm_d > 0L),
if_d_n = ~as.integer(nm_d_n > 0L),
if_d_s = ~as.integer(nm_d_s > 0L),
if_e = ~as.integer(nm_e > 0L),
if_e_n = ~as.integer(nm_e_n > 0L),
if_e_s = ~as.integer(nm_e_s > 0L),
if_end = ~as.integer(nm_end > 0L),
if_i = ~as.integer(nm_i > 0L),
if_ii = ~as.integer(nm_ii > 0L),
if_m = ~as.integer(nm_m > 0L),
if_n = ~as.integer(nm_n > 0L),
if_nnd = ~as.integer(nm_nnd > 0L),
if_p = ~as.integer(nm_p > 0L),
if_p_n = ~as.integer(nm_p_n > 0L),
if_p_s = ~as.integer(nm_p_s > 0L),
if_pnd = ~as.integer(nm_pnd > 0L),
if_pnd_n = ~as.integer(nm_pnd_n > 0L),
if_pnd_s = ~as.integer(nm_pnd_s > 0L),
if_s = ~as.integer(nm_s > 0L),
if_s_n = ~as.integer(nm_s_n > 0L),
if_s_s = ~as.integer(nm_s_s > 0L),
if_snd = ~as.integer(nm_snd > 0L),
if_x_s = ~as.integer(nm_x_s > 0L),
if_x_n = ~as.integer(nm_x_n > 0L),
pm_b = ~coalesce(100L * nm_b / len, NA_real_),
pm_b2 = ~coalesce(100L * nm_b2 / len, NA_real_),
pm_b_n = ~coalesce(100L * nm_b / nm_x_n, NA_real_),
pm_bd = ~coalesce(100L * nm_bd / len, NA_real_),
pm_bd_n = ~coalesce(100L * nm_bd_n / nm_x_n, NA_real_),
pm_bd_s = ~coalesce(100L * nm_bd_s / nm_x_s, NA_real_),
pm_be = ~coalesce((len - nm_e) / len, NA_real_),
pm_bp = ~coalesce((len - nm_p) / len, NA_real_),
pm_d = ~coalesce(100L * nm_d / len, NA_real_),
pm_d_n = ~coalesce(100L * nm_d_n / nm_x_n, NA_real_),
pm_d_s = ~coalesce(100L * nm_d_s / nm_x_s, NA_real_),
pm_e = ~coalesce(100L * nm_e / len, NA_real_),
pm_e_n = ~coalesce(100L * nm_e_n / nm_x_n, NA_real_),
pm_e_s = ~coalesce(100L * nm_e_s / nm_x_s, NA_real_),
pm_end = ~coalesce(100L * nm_end / len, NA_real_),
pm_i = ~coalesce(100L * nm_i / len, NA_real_),
pm_i_n = ~coalesce(100L * nm_i_n / nm_x_n, NA_real_),
pm_i_s = ~coalesce(100L * nm_i_s / nm_x_s, NA_real_),
pm_ii = ~coalesce(100L * nm_ii / len, NA_real_),
pm_ii_n = ~coalesce(100L * nm_ii_n / nm_x_n, NA_real_),
pm_ii_s = ~coalesce(100L * nm_ii_s / nm_x_s, NA_real_),
pm_n = ~coalesce(100L * nm_n / len, NA_real_),
pm_n_n = ~coalesce(100L * nm_n_n / nm_x_n, NA_real_),
pm_n_s = ~coalesce(100L * nm_n_s / nm_x_s, NA_real_),
pm_nnd = ~coalesce(100L * nm_nnd / len, NA_real_),
pm_p = ~coalesce(100L * nm_p / len, NA_real_),
pm_p_n = ~coalesce(100L * nm_p_n / nm_x_n, NA_real_),
pm_p_s = ~coalesce(100L * nm_p_s / nm_x_s, NA_real_),
pm_pnd = ~coalesce(100L * nm_pnd / len, NA_real_),
pm_pnd_n = ~coalesce(100L * nm_pnd_n / nm_x_n, NA_real_),
pm_pnd_s = ~coalesce(100L * nm_pnd_s / nm_x_s, NA_real_),
pm_s = ~coalesce(100L * nm_s / len, NA_real_),
pm_s_n = ~coalesce(100L * nm_s_n / nm_x_n, NA_real_),
pm_s_s = ~coalesce(100L * nm_s_s / nm_x_s, NA_real_),
pm_snd = ~coalesce(100L * nm_snd / len, NA_real_),
pm_x_n = ~coalesce(100L * nm_x_n / len, NA_real_),
pm_x_s = ~coalesce(100L * nm_x_s / len, NA_real_),
ez_e = ~coalesce(sz_e / nm_e, NA_real_),
ez_e_n = ~coalesce(sz_e_n / nm_e_n, NA_real_),
ez_e_s = ~coalesce(sz_e_s / nm_e_s, NA_real_),
ez_x = ~coalesce(sz_x / len, NA_real_),
ez_z = ~coalesce(sz_z / nm_z, NA_real_),
ez_z_n = ~coalesce(sz_z_n / nm_z_n, NA_real_),
ez_z_s = ~coalesce(sz_z_s / nm_z_s, NA_real_)
) %>%
mutate_(
wzg_ez_e = ~coalesce(ez_e / ezpow_e, NA_real_),
wzg_ez_e_n = ~coalesce(ez_e_n / ezpow_e_n, NA_real_),
wzg_ez_e_s = ~coalesce(ez_e_s / ezpow_e_s, NA_real_),
wzg_ez_z = ~coalesce(ez_z / ezpow_z, NA_real_),
wzg_ez_z_n = ~coalesce(ez_z_n / ezpow_n, NA_real_),
wzg_ez_z_s = ~coalesce(ez_z_s / ezpow_s, NA_real_),
wzg_ryzbez = ~coalesce(pm_b / ppow_b, 0),
wzg_ryzbez_n = ~coalesce(pm_b_n / ppow_b_n, 0),
status = ~if_end + if_nnd*2 + if_snd*4 + if_d*8 + if_b*16 + if_i*32 + if_x_s*64
) %>%
ungroup()
return(dane)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.