I am new to R and am trying to generate a volcano plot of DEGs in my study. Unfortunately, I am having some trouble with the data frame. It seemed to format the genes as a header column but I need to access them in order to annotate my plot. Is there any way to call that column or possibly reformat it through R so that there is a new column titled "genes"? I appreciate any feedback, thank you!
I've tried to reformat the table outside of R but has led to no solution as it doesn't seem to recognize the file even though it is still a .csv.
I'd like to be able to run this line, where the top 30 genes are marked on the plot:
df$delabel <- ifelse(df$gene %in% head(df[order(df$p_val_adj), "gene"], 30),
df$gene,
NA)