Question: The program is r markdown 10- # Problem 1 11 12 *The function 'parent.envo' returns the parent environment of an input 13 environment, and if

 The program is r markdown 10- # Problem 1 11 12*The function 'parent.envo' returns the parent environment of an input 13 environment,and if env' is an environment, then ls(envir = env) returns a

The program is r markdown

10- # Problem 1 11 12 *The function 'parent.envo' returns the parent environment of an input 13 environment, and if env' is an environment, then ls(envir = env) returns a 14 character vector listing all objects in the environment. Write a function 15 "Is_ancestors that takes an environment 'envir' as an input and returns all 16 object names not just in the input environment but all ancestor environments 17 too. (Hint: your function should use a while loop that terminates when it 18 reaches the ultimate ancestor of all environments: the empty environment, the 19 only environment without an ancestor.) **BEWARE: IF YOUR CODE TAKES LONGER THAN 20 10 SECONDS TO RUN, YOU WILL NOT RECEIVE CREDIT!*** 21 22 - "'{r, error = TRUE} 23 - ls_ancestors

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!