Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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_ancestorsStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started