Exercise 3: Vectors and Lists
Understand how to determine if a variable in R is recursive by working with vectors and lists. Learn to use functions that check recursion status and display outputs with cat(), enhancing your data structure skills in R.
We'll cover the following...
We'll cover the following...
Problem Statement
Use a function that checks whether the testVariable is recursive or not.
Use
cat()to display your result on the screen.
Input
A testVariable containing the object being tested.
Output
true if the variable is recursive and false otherwise.
Sample Input
list(1, 1+1i, "a", TRUE)
Sample Output
TRUE
Test Yourself
Write your code in the given area. If you get stuck, you can look at the solution.