Question: Consider the list created below. Write a short script using lapply() to test which elements in the list are functions. Then return only those list

Consider the list created below. Write a short script using lapply() to test which elements in the list are functions. Then return only those list elements which are functions. Make sure that the function you create will work with arbitrary lists. It is not acceptable to just figure out yourself which elements contain functions and subset bigList below. Make it automated and flexible.

```{r} bigList <- list(x = 1:8, y = data.frame(norm = rnorm(5, 0, 1)), z = function(x) {x}, t1 = function(x, y) {x + y ^ exp(x)}, char = "This is a character", t2 = function(lambda) {lambda ^ (1 / pi)}) bigList ```

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!