I am very new so bare with me. I have a file called data (.csv that I turned into a data table) with 2 columns (geneid, normalized counts) and about 9000 rows. I have a second file called Xgenes of genes that I am interested in pulling out of the first table (1 column- geneid, about 50 rows).
Is there a way to make 2 new files- I want one with all the geneid/normalized counts minus the ones in the second file (so minus about 50 genes). Then I want to make another file that only has the geneid/normalized counts of the 50 genes in the second file.
Currently I am doing this manually which does indeed work but if there is a way to do it through R it would make my future analysis much easier.
Thanks!
df1$col1 %in% df2$col1
and!(df1$col1 %in% df2$col1)
. $\endgroup$awk
or forward your R code for loading a dataframe, which will give you access to the above code. Once you've a bit of code to share thats when help is more available. $\endgroup$dput()
on your data to get a copy/paste ready version that you can share here. That makes it easier to understand how your data look and therefore easier to come up with solutions. $\endgroup$