Skip to content

Commit c51c7a8

Browse files
committed
Update helper functions
1 parent f5e0f0d commit c51c7a8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

helperfuns_plots_4.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ stacked_plot <- function(df, variable, fill_vars, facet_vars=NULL, facet_wrap=FA
2929

3030
p <- if (is.factor(index)| is.logical(index)) {
3131
p1 <- if (rotate_axis == TRUE) {
32-
ggplot(data=df, aes(x= forcats::fct_rev(index), fill = forcats::fct_rev(forcats::fct_infreq(index_fill)),
32+
ggplot(data=df, aes(x= forcats::fct_rev(index), fill = forcats::fct_infreq(index_fill),
3333
by = forcats::fct_rev(index))
3434
) +
3535
coord_flip()
36-
} else { ggplot(data=df, aes(x=index, fill = forcats::fct_rev(forcats::fct_infreq(index_fill)),
36+
} else { ggplot(data=df, aes(x=index, fill = forcats::fct_infreq(index_fill),
3737
by = index)
3838
)
3939
}
@@ -109,11 +109,11 @@ stacked_plot <- function(df, variable, fill_vars, facet_vars=NULL, facet_wrap=FA
109109

110110
p <- if (is.factor(index)| is.logical(index)) {
111111
p1 <- if (rotate_axis == TRUE) {
112-
ggplot(data=df, aes(x= forcats::fct_rev(index), fill = forcats::fct_rev(forcats::fct_infreq(index_fill)),
112+
ggplot(data=df, aes(x= forcats::fct_rev(index), fill = forcats::fct_infreq(index_fill),
113113
by = forcats::fct_rev(index))
114114
) +
115115
coord_flip()
116-
} else { ggplot(data=df, aes(x=index, fill = forcats::fct_rev(forcats::fct_infreq(index_fill)),
116+
} else { ggplot(data=df, aes(x=index, fill = forcats::fct_infreq(index_fill),
117117
by = index)
118118
)
119119
}

0 commit comments

Comments
 (0)