Closed laallison closed 4 years ago
This will keep the legends in the same order throughout the report.
function (hydrograph_df) { long_hydrograph <- tidyr::pivot_longer(hydrograph_df, cols = c(WS_Elev, Obs_WS, Model_Q, Obs_Q), names_to = "Type", values_to = "value") long_hydrograph$Type <- factor(long_hydrograph$Type,levels = c("WS_Elev","Obs_WS", "Model_Q", "Obs_Q"), labels = c("WS_Elev","Obs_WS", "Model_Q", "Obs_Q")) return(long_hydrograph) }
Could we add the na.omit() capability to this as well?
Ordered the Type factor and omitted NAs: bb79a1996cf5b3c76e6bc3658e786a6b6e272bf4
This will keep the legends in the same order throughout the report.
function (hydrograph_df) { long_hydrograph <- tidyr::pivot_longer(hydrograph_df, cols = c(WS_Elev, Obs_WS, Model_Q, Obs_Q), names_to = "Type", values_to = "value") long_hydrograph$Type <- factor(long_hydrograph$Type,levels = c("WS_Elev","Obs_WS", "Model_Q", "Obs_Q"), labels = c("WS_Elev","Obs_WS", "Model_Q", "Obs_Q")) return(long_hydrograph) }