Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problems with R a. The following block of code was used to recode some of the key variables that you will use in this problem

Problems with R

image text in transcribed

a. The following block of code was used to recode some of the key variables that you will use in this problem set. In your own words, describe how the recode() function works. What is the first argument? What are the subsequent arguments? Note: you do NOT need to run this code. Your task is to interpret it. d = d %>% rename age = AGEP commute_time = JWMNP ) %>% mutate employment status = recode ESR, Civilian employed, at work', *2 = 'Civilian employed, with a job but not at work', 3' = 'Unemployed', 1 -01" = 4 = 'Armed forces, at work, *5' = 'Armed forces, with a job but not at work', 69 = 'Not in labor force ), means_of_transport = recode JWTRNS, Car, truck, or van', -02* = Bus', 03 = 'Train or streetcar', 04" = 'Train or streetcar', 05* = Train or streetcar', *06* = Ferryboat', -07 = 'Other method', -08" = Other method', *09* = Bicycle', *10' = 'Walked 11 = Worked from home', 12 = Other method missing = "Does not commute to work ), number_in_carpool - as numeric JWRIP ) ) b. Using the same block of code, describe how the function rename() works. c. Describe the role that the pipe operator, %>%, plays in the same block of code

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

Introduction To Data Mining

Authors: Pang Ning Tan, Michael Steinbach, Vipin Kumar

1st Edition

321321367, 978-0321321367

More Books

Students also viewed these Databases questions