Skip to content

Commit

Permalink
Add ggplot2:: before aes()
Browse files Browse the repository at this point in the history
Following #86
  • Loading branch information
damianooldoni committed Aug 8, 2022
1 parent 2e84082 commit 3155359
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
6 changes: 4 additions & 2 deletions R/visualize_pathways_level1.R
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,9 @@ visualize_pathways_level1 <- function(df,
ggplot2::ggplot(
data_top_graph
) +
ggplot2::geom_bar(aes(x = forcats::fct_rev(.data$pathway_level1))) +
ggplot2::geom_bar(
ggplot2::aes(x = forcats::fct_rev(.data$pathway_level1))
) +
ggplot2::xlab(y_lab) +
ggplot2::ylab(x_lab) +
ggplot2::coord_flip() +
Expand All @@ -404,7 +406,7 @@ visualize_pathways_level1 <- function(df,
facet_graph <-
ggplot2::ggplot(
df,
aes(x = forcats::fct_rev(.data$pathway_level1))
ggplot2::aes(x = forcats::fct_rev(.data$pathway_level1))
) +
ggplot2::geom_bar() +
ggplot2::xlab(y_lab) +
Expand Down
4 changes: 2 additions & 2 deletions R/visualize_pathways_level2.R
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ visualize_pathways_level2 <- function(df,
top_graph <-
ggplot2::ggplot(
data_top_graph,
aes(x = forcats::fct_rev(.data$pathway_level2))
ggplot2::aes(x = forcats::fct_rev(.data$pathway_level2))
) +
ggplot2::geom_bar() +
ggplot2::xlab(y_lab) +
Expand All @@ -481,7 +481,7 @@ visualize_pathways_level2 <- function(df,
facet_graph <-
ggplot2::ggplot(
df,
aes(x = forcats::fct_rev(.data$pathway_level2))
ggplot2::aes(x = forcats::fct_rev(.data$pathway_level2))
) +
ggplot2::geom_bar() +
ggplot2::xlab(y_lab) + # invert labels to get them right after flipping
Expand Down
8 changes: 4 additions & 4 deletions R/visualize_pathways_year_level1.R
Original file line number Diff line number Diff line change
Expand Up @@ -468,13 +468,13 @@ visualize_pathways_year_level1 <- function(
max_n <- max(data_top_graph$n)
top_graph <-
ggplot2::ggplot(data_top_graph) +
ggplot2::geom_line(aes(
ggplot2::geom_line(ggplot2::aes(
x = .data$bins_first_observed,
y = .data$n,
group = .data$pathway_level1,
color = .data$pathway_level1
)) +
geom_point(aes(
geom_point(ggplot2::aes(
x = .data$bins_first_observed,
y = .data$n,
group = .data$pathway_level1,
Expand Down Expand Up @@ -508,13 +508,13 @@ visualize_pathways_year_level1 <- function(
max_n <- max(data_facet_graph$n)
facet_graph <-
ggplot2::ggplot(data_facet_graph) +
ggplot2::geom_line(aes(
ggplot2::geom_line(ggplot2::aes(
x = .data$bins_first_observed,
y = .data$n,
group = .data$pathway_level1,
color = .data$pathway_level1
)) +
geom_point(aes(
geom_point(ggplot2::aes(
x = .data$bins_first_observed,
y = .data$n,
group = .data$pathway_level1,
Expand Down

0 comments on commit 3155359

Please sign in to comment.