我试图通过一个循环将多个GSM文件加载到R中,但我认为我遗漏了一些显而易见的东西。
#Use i to loop through NCBI files GSM9714940 through GSM971948
for (i in 971940:971948){
(GSMName <- paste("GSM", i, sep = "")) #Define the actual file name as found on NCBI
GSMName <- getGEO(GSMName, destdir=".") #Use GSMName variable to pull data from NCBI
#This doesn't work b/c I'm using a variable to redefine itself, but
#I need the NCBI file name to also be the variable name
}
发布于 2017-06-06 19:08:36
您可以使用assign()
for (i in 971940:971948){
GSMName <- paste("GSM", i, sep = "")
assign(GSMName, getGEO(GSMName, destdir="."))
}
https://stackoverflow.com/questions/44397915
复制相似问题