I am trying to run a gene set enrichment analysis following the vignette here: http://yulab-smu.top/clusterProfiler-book/chapter7.html
I have been trying to use this particular code:
data(df, package="DOSE")
gene <- names(df)[abs(df) > 2]
head(gene)
When I run the above I get the following error:
data set ‘df’ not found[1] NA NA NA NA NA NA
[1] FALSE
I am trying to apply a cut off of 1 to a dataset of Log2FoldChange (values from -x through to +x). I would then like to take this and the corresponding names (ENTREZ ID) and put it into a data frame named gene so I can then run the enrichment analysis.
If I specify columns of the data:
#Define DEG as LFC>1
data(df, package="DOSE")
gene <- names(df$ENTREZ)[abs(df$log2FoldChange) > 2]
head(gene)
gene <- (abs(1) > 1)
head(gene)
I get:
data set ‘df’ not foundNULL
[1] FALSE
The above 'abs()' function doesnt work (I have copied and modified as above from the vignette).
I have found another explanation here that suggests perhaps a different route. Ordering multiple columns using cut-off values in R
Have I missed some syntax to get this work? Any help would be greatly appreciated.
Thank you