0

The data is similar to that indicated as below. It would greatly be appreciated if somebody can help me in this case.

Gene Control expression Cancer expression BAX 12 34 BID 18 45 PMAIP1 10 24
The graph should depict all the gene candidates in the x-axis and the expression level in the y-axis grouped by tumor and normal for each gene. The example has shown. enter image description here

1 Answers1

0

If your data does have the same formate as in my example, this code should work:

library(tidyverse)
data <- data.frame(value = rnorm(120, mean = 5),
                   genes = rep(c("A", "B", "C", "D", "E", "F"), each = 20),
                   condition = rep(c("tumor", "normal"), times = 60))

data %>%
  ggplot(aes(x = genes, y = value, fill = condition))+
  geom_boxplot()+
  theme_classic()

Created on 2022-09-13 with reprex v2.0.2

Noah
  • 440
  • 2
  • 9