When I use the 'lapply' function for data in the format of 'GRanges', the system prompts an error, so what are the good solutions? (((Thank you!
data(IlluminaHumanMethylationEPICanno.ilm10b4.hg19)
data(Locations)
locs<-Locations
locs.ranges<-GRanges(Locations$chr,IRanges(Locations$pos,Locations$pos))
names(locs.ranges)<-rownames(Locations)
DMR.IDs<-lapply(results.ranges,function(x) names(locs.ranges[locs.ranges %over% x]))
GRanges objects don't support [[, as.list(), lapply(), or unlist() at the
moment
sessionInfo( )
However, keep in mind that lapply-based solutions tend to be quite inefficient so should be avoided whenever possible. In your case a much better way is to do: