Re: [R] Generate list if sequence form two vector element

2016-06-23 Thread PIKAL Petr
; Cc: R-help Mailing List > Subject: Re: [R] Generate list if sequence form two vector element > > Hi Tanvir, > Not at all elegant, but: > > make.seq<-function(x) return(seq(x[1],x[2])) > apply(matrix(c(a,b),ncol=2),1,make.seq) > > Jim > > > On Wed, Jun 22, 2016 a

Re: [R] Generate list if sequence form two vector element

2016-06-22 Thread Jim Lemon
Hi Tanvir, Not at all elegant, but: make.seq<-function(x) return(seq(x[1],x[2])) apply(matrix(c(a,b),ncol=2),1,make.seq) Jim On Wed, Jun 22, 2016 at 5:32 PM, Mohammad Tanvir Ahamed via R-help wrote: > Hi, > I want to do the follow thing > > Input : > a <- c(1,3,6,9) > > > b<-c(10,7,20,2) > > >

[R] Generate list if sequence form two vector element

2016-06-22 Thread Mohammad Tanvir Ahamed via R-help
Hi, I want to do the follow thing Input : a <- c(1,3,6,9) b<-c(10,7,20,2) Expected outcome : d<-list(1:10,3:7,6:20,2:9) Thanks !! Tanvir Ahamed Göteborg, Sweden | mashra...@yahoo.com __ R-help@r-project.org mailing list -- To UNSUBS