I am having issues getting a plot for my dataframe. Attached below is my sample matrix dataframe. This class is confirmed a dataframe.
Dataframe (10 rows, 59 columns originally)
I have originally tried to create a plot using facet_grid, with poor results.
(Error: At least one layer must contain all faceting variables: x
.
- Plot is missing
x
- Layer 1 is missing
x
)
Instead, I decided to simplify it and create a box plot with everything on 1 graph. However, my graph looked like this: ugly graph
My simple plot code is below; does anyone know why things are plotted poorly? Any insight is helpful. This is my first post, so I hope things are formatted correctly.
ggplot(newdf, aes(x, y, fill = x))+ geom_boxplot()
The end goal would be a boxplot shown for each gene with the observations of the individuals within each box. I am following this example:example