I am also new to R but it looks like you havent set the file variable accurately. It shouldn’t matter than each column varies in number of records…
write.table(path.to.genes,file="Adj_Abs_pathway list",row.names=FALSE, sep=' ')
Hope this helps :S
Lel