Hi -- there are lots of replies --I have not read them all, if someone else suggested this, sorry for duplication. This is similar to the suggestion using mapply, but not specific to matrices. In fact it's a kludge that applies to many settings. You 'sapply' over the index 1:2, and pass a, b as arguments:
a <- c(1,4) b <- c(5,8) sapply(1:2, FUN=function(x, a, b)a[x]:b[x], a=a,b=b) -----Original Message----- From: r-help-requ...@r-project.org <r-help-requ...@r-project.org> Sent: Monday, October 05, 2020 6:04 AM To: r-help@r-project.org Subject: R-help Digest, Vol 212, Issue 4 Send R-help mailing list submissions to r-help@r-project.org To subscribe or unsubscribe via the World Wide Web, visit https://stat.ethz.ch/mailman/listinfo/r-help or, via email, send a message with subject or body 'help' to r-help-requ...@r-project.org You can reach the person managing the list at r-help-ow...@r-project.org When replying, please edit your Subject line so it is more specific than "Re: Contents of R-help digest..." ______________________________________________ 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.