I got this result. Didn't you?
data <- data.frame(
Pathway = c("BIOCARTA_IL12_PATHWAY", "CONRAD_STEM_CELL"),
group1 = c(0.027233015, -0.025555915),
group2 = c(-0.01753847, 0.01116901)
)
data <- melt(data, id.vars = "Pathway", variable.name = "Genotype", value.name = "Beta")
#Warning message:
#The melt generic in data.table has been passed a data.frame and will attempt to redirect to the relevant reshape2 method; please note that reshape2 is #superseded and is no longer actively developed, and this redirection is now deprecated. To continue using melt methods from reshape2 while both libraries #are attached, e.g. melt.list, you can prepend the namespace, i.e. reshape2::melt(data). In the next version, this warning will become an error.
data
Pathway Genotype Beta
1 BIOCARTA_IL12_PATHWAY group1 0.02723301
2 CONRAD_STEM_CELL group1 -0.02555591
3 BIOCARTA_IL12_PATHWAY group2 -0.01753847
4 CONRAD_STEM_CELL group2 0.01116901
ggplot(data, aes(x = Pathway, y = Beta, fill = Genotype)) +
geom_bar(stat = "identity", position = position_dodge()) +
theme(axis.text.x = element_text(angle = 45, hjust = 1, size = 20, face = "bold"))
