Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Exercise Creating a named list Well done, you're on a roll! Just like on your to - do list, you want to avoid not knowing

Exercise
Creating a named list
Well done, you're on a roll!
Just like on your to-do list, you want to avoid not knowing or remembering what the components of your list stand for. That is why you should give names to them:
This creates a list with components that are named name1, name2, and so on. If you want to name your lists after you've created them, you can use the names() function as you did with vectors. The following commands are fully equivalent to the assignment above:
myList - List(yourcomp1,yourcomp2)
names (nylist)-c(name1, name2)
Instructions
100P
Change the code of the previous exercise (see editor) by adding names to the components. Use for my_vector the name vec, for my_matrix the name mat and for imy_df the name df .
Print out my_list so you can inspect the output.
script:R
F Vector with numerics from 1 up to 10 my_vector -1:10
# Matrix with numerics from 1 up to 9
my_matrix - matrix , ncol =3
# First 10 elements of the built-in data frame mtcars my_df - mtcars ,
# Adapt list() call to give the components names my_list - list(my_vector, my_matrix, my_df)
# Print out my_list
R Console
image text in transcribed

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

Entity Alignment Concepts Recent Advances And Novel Approaches

Authors: Xiang Zhao ,Weixin Zeng ,Jiuyang Tang

1st Edition

9819942527, 978-9819942527

Students also viewed these Databases questions

Question

Discuss the Hawthorne experiments in detail

Answered: 1 week ago

Question

Explain the characteristics of a good system of control

Answered: 1 week ago

Question

State the importance of control

Answered: 1 week ago

Question

What are the functions of top management?

Answered: 1 week ago