?lapply See also the"Intro to R" tutorial that ships with R. We(or at least I) expect you to do your own homework learning basic R before posting here. This is not a substitute for such efforts, but we are willing to help when you get stuck. See the posting guide linked below and show us your own coding efforts.
Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Sat, Jul 20, 2019 at 5:16 PM Jackson Rodrigues < jacksonmrodrig...@gmail.com> wrote: > Dear all, > > > My name is Jackson and I need a help in applying functions to a list of > tables. > > > Could anyone help me to use loop/array on a list of tables ? > > I need to apply a group of functions (listed below) to a list of tables > > I am not that good with loops or arrays or multiple functions. > > So, could some of you help me ? > > > mylist <- list.files(full.names = F, pattern =".asc$") > > mylist > > [1] table1.asc" " table2.asc" > [3] " table3.asc" " table4.asc " > [5] " table5.asc " > > The <https://www.facebook.com/hashtag/the?source=feed_text&epa=HASHTAG> > following > functions should be applied to each table from mylist > > ###### > > in.r=read.table(mylist,sep="",skip=7,header=F) > > cl=read.table(mylist,sep="",nrows=1,header=F) > > rw=read.table(mylist,sep="",nrows=1,skip=1,header=F) > > xll=read.table(mylist,sep="",nrows=1,skip=2,header=F) > > yll=read.table(mylist,sep="",nrows=1,skip=3,header=F) > > xdim=read.table(mylist,sep="",nrows=1,skip=4,header=F) > > ydim=read.table(mylist,sep="",nrows=1,skip=5,header=F) > > nd=read.table(mylist,sep="",nrows=1,skip=6,header=F) > > > #Convert > <https://www.facebook.com/hashtag/convert?source=feed_text&epa=HASHTAG> to > Raster > > in.rr=raster(as.matrix(in.r)) > > in.rr[in.rr == -9999]=NA > > x.max=xll$V2+(xdim$V2*cl$V2) > > y.max=yll$V2+(ydim$V2*rw$V2) > > extent(in.rr)=c(xll$V2,x.max,yll$V2,y.max) > > ################# > > > Thank you all in advance. > > > Jackson Rodrigues > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.