I am interested to skip some lines of my data frame before the header names . How can i do it by skiping all the lines before ID_REF or if ID_REF is not present, check for the pattern ILMN_ and deleting all the lines keeping immediate first if not containing #.
# GEOarchive matrix file.
ID_REF 1688628068_A.AVG_Signal 1688628068_A.Avg_NBEADS 1688628068_A.BEAD_STDERR 1688628068_A.Detection Pval
ILMN_1343291 62821.84 135 413.9399 0
ILMN_1343292 3255.167 131 47.76587 0
ILMN_1343293 42924.91 152 539.3026 0
ILMN_1343294 55255.21 100 746.1457 0
In linux, you could use
awkwithfreador it can be piped withread.table. Here, I changed the delimiter to,usingawkand read with
freadOr using
read.tableNOTE: I changed the column name from
1688628068_A.Detection Pvalto1688628068_A.Detection_PvalFor some reason, the extra spaces is creating problems with
fread. Withread.tableit is not an issue. So, the following also works fine withread.table