I have a data frame (although I don't think that the kind of source object I have matters) that has a list of 51 genes that I would like to get the pathway information for (using rWikiPathways, but, again, this can be applied to much more general issues too).
I would like to create an object with the information retrieved from rWikiPathways for each of these 51 genes.
I have been trying to use for loops, assign and paste functions but nothing is really working as I would like it to, so I ended up copying this line of code 51 times:
pathway.gene.1 <- findPathwaysByXref(genes$Encode.ID[1], "En")
pathway.gene.2 <- findPathwaysByXref(genes$Encode.ID[2], "En")
...
pathway.gene.51 <- findPathwaysByXref(genes$Encode.ID[51], "En")
Note that "...gene.1" and "Encode.ID[1]" all go from 1 to 51.
There has to be a way to do this automagically... I am a beginner and can't really make it happen.
Any tips out there?
Cheerio, Guido