Re: [R] Use mapply or lapply to a nested list

2020-12-21 Thread Ben Tupper
You might be able to get mapply to work, but because your lists differ in lengths you will get some recycling which may lead to mayhem for you. Below I have tried to simplify and clarify by naming the elements of your lists, but I don't get 20 results. I get 4 elements (one for each k). Each kth

[R] Use mapply or lapply to a nested list

2020-12-21 Thread Chao Liu
I want to apply a sample function to a nested list (I will call this list `bb`) and I also have a list of numbers (I will call this list `k`) to be supplied in the sample function. I would like each of the numbers in k to iterate through all the values of each list in bb. How to do this using `mapp