Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases And Python Programming MySQL MongoDB OOP And Tkinter

Authors: R. PANNEERSELVAM

1st Edition

9357011331, 978-9357011334

More Books

Students also viewed these Databases questions

Question

2. Do you find change a. invigorating? b. stressful? _______

Answered: 1 week ago

Question

How was their resistance overcome?

Answered: 1 week ago