Hi y'all. I am VERY new to code, and I am trying to get the results of three conditionals that I need to run against each other. The conditions are "old", "young" and "adult". I am running a basic code of:
Code should be placed in three backticks as shown below
res_age <- results(dds, contrast = c("age", "old" "young", "adult"))
res_age
write.csv(res_age, "deseq_age.csv")
but I get an error since I cannot run more than 2 conditionals together at once. However, when I attempt to run the code doing two at a time such as old and young, young and adult, and adult and old, none of my code seems to be working. I have tried setting up a code like this:
##results for age
res_age <- results(dds, contrast = c("age", "young", "adult"))
res_age
write.csv(res_age, "deseq_age.csv")
##results for age 2
res_age_2 <- results(dds, contrast = c("age", "old", "young"))
res_age_2
write.csv(res_age_2, "deseq_age_2.csv")
##results for age 3
res_age_3 <- results(dds, contrast = c("age", "old", "adult"))
res_age_3
write.csv(res_age_3, "deseq_age_3.csv")
but I get an error after the first line saying
Error in cleanContrast(object, contrast, expanded = isExpanded, listValues = listValues, :
as adult is the reference level, was expecting age_young_vs_adult to be present in 'resultsNames(object)
how would I go about running each of these three conditions against each other so that I will have old vs young, young vs adult, and adult vs old. Thank you!!!!