Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi how do I create tibble named `body` as using `mutate` of `bdims` in which I change variable `sex` to a factor with use of

Hi how do I create tibble named `body` as using `mutate` of `bdims` in which I change variable `sex` to a factor with use of `factor()` with `levels = c(0, 1)`, and recode the factor levels of `sex` to `f` and `m` instead of `0` and `1` using fct_recode().

This is what I've tried, but does not work as intended.

body <- tibble( mutate(bdims, factor(sex, levels = c(0, 1)), fct_recode(bdims$sex, f = "0", m = "1")) )

running packages:

library(tidyverse) library(openintro) library(broom) library(lubridate) library(janitor)

Thanks in advance.

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

Financial Accounting

Authors: Jerry J. Weygandt, Paul D. Kimmel, Donald E. Kieso, J. Mather

8th Edition

0470929383, 978-0470929384

More Books

Students also viewed these Accounting questions

Question

What is a process and process table?

Answered: 1 week ago

Question

What is Industrial Economics and Theory of Firm?

Answered: 1 week ago

Question

What is the meaning and definition of E-Business?

Answered: 1 week ago