Ho un dataframe enrichment_df
che assomiglia a questoCome usare nomi e nomi di un dataframe per l'aes di ggplot?
meclocycline pimozide isocorydine alvespimycin
day1_day3__sham3_strict_enrichment -0.869 0.855 -0.859 0.539
hour4_day1_day3__sham3_strict_enrichment -0.294 0.268 -0.539 -0.120
day7_day14__sham3_strict_enrichment -0.333 0.404 0.297 0.233
day90__sham3_strict_enrichment -0.511 -0.657 -0.519 0.184
day14__sham3_strict_enrichment -0.239 -0.420 0.513 -0.422
day7__sham3_strict_enrichment -0.394 -0.380 -0.408 0.337
e voglio fare un barplot sovrapposizione con l'esempio da https://stackoverflow.com/a/23228273/651779. Voglio che il riempimento sia il rownames e l'asse x i nomi. Io cerco di tracciare con
ggplot(enrichment_df, aes_string(names(enrichment_df), fill = rownames(enrichment_df))) +
geom_bar(position = 'identity', alpha = .3)
Tuttavia, questo dà l'errore object 'day1_day3__sham3_strict_enrichment' not found
Come posso utilizzare i rownames e colnames nei aes (o aes_string) di ggplot?