Re: [R] Using lapply with two lists

2010-03-26 Thread anna
Yes thank you Jorge :working: - Anna Lippel -- View this message in context: http://n4.nabble.com/Using-lapply-with-two-lists-tp1692883p1692898.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list htt

Re: [R] Using lapply with two lists

2010-03-26 Thread Jorge Ivan Velez
Hi Anna, Here is a suggestion: # creating L1 L1 <- lapply(1:5, function(x) matrix(rnorm(10), ncol = 2)) L1 # creating L2 L2 <- lapply(1:5, function(x) sample(5, 2)) L2 # defining a function foo <- function(x, y) list(x[-y,]) # result mapply(foo, L1, L2) HTH, Jorge On Fri, Mar 26, 2010 at 5:3

Re: [R] Using lapply with two lists

2010-03-26 Thread Riley, Steve
Anna, See ?mapply I think you should be able to use that. Steve Riley, Pharm.D., Ph.D. Clinical Pharmacology, Specialty Neuroscience Pfizer Specialty Care Business Unit Mail Stop MS 6025-B2110 50 Pequot Ave New London, CT 06320 steve.ri...@pfizer.com Tel: (860) 732-1796 Fax: (860) 686-567