logo Use CA10RAM to get 10%* Discount.
Order Nowlogo
(5/5)

Classify the participants into the following `age_group`s

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

# Required packages

```r

install.packages("tidyverse")

```

# Default path

If you don't use RStudio, you need to set the working directory to the same folder with the `.Rproj` file.

# Filtering and ordering

# ===

# Goal: Filter the tibble for "dog" owners. 

#       Then, order the result from Z to A according to the name of the `owner`. 

# Functions: filter(), str_detect(), arrange(), desc()

# Example output: 

#      # A tibble: 2 x 2

#        owner  pet                 

#        <chr>  <chr>               

#      1 Sanjiv white dog           

#      2 Gunnar dog with an attitude

#

# Relevant R4DS chapter: https://r4ds.had.co.nz/transform.html?q=filter#filter-rows-with-filter

 

#===============================================================================

# Mutating and condition

# ===

# Goals: 

# 1. Classify the participants into the following `age_group`s:

#     * Baby: 0 - 2

#     * Young adults: 3 - 39

#     * Middle-aged adults: 40 - 59

#     * Old adults: ≥ 60.

#

# 2. Add a column to indicate `score_level`: low (< 6) or high (≥ 6).

#

# Functions: 

#   * mutate(), between()

#   * Use this function once: if_else()

#   * Use this function once: case_when()

# Example output: 

#

#      # A tibble: 10 x 5

#         participant_id   age score age_group          score_level

#         <chr>          <dbl> <dbl> <chr>              <chr>      

#       1 P01               43     5 Middle-aged adults low        

#       2 P02               40     4 Middle-aged adults low        

#       3 P03               29     7 Young adults       high       

#       4 P04               84     7 Old adults         high       

#       5 P05               89     3 Old adults         low        

#       6 P06                6     7 Young adults       high       

#       7 P07               57     9 Middle-aged adults high       

#       8 P08               71     4 Old adults         low        

#       9 P09               88     7 Old adults         high       

#      10 P10               13     9 Young adults       high     

#

# Relevant R4DS chapter: 

# * https://r4ds.had.co.nz/transform.html

# * Additionally, this "Missing values" section https://r4ds.had.co.nz/exploratory-data-analysis.html#missing-values-2

 

#===============================================================================

 

(5/5)
Attachments:

Expert's Answer

519 Times Downloaded

Related Questions

. Introgramming & Unix Fall 2018, CRN 44882, Oakland University Homework Assignment 6 - Using Arrays and Functions in C

DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma

. The standard path finding involves finding the (shortest) path from an origin to a destination, typically on a map. This is an

Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t

. Develop a program to emulate a purchase transaction at a retail store. This program will have two classes, a LineItem class and a Transaction class. The LineItem class will represent an individual

Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th

. SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

. Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

519 Times Downloaded

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Um e HaniScience

807 Answers

Hire Me
expert
Muhammad Ali HaiderFinance

729 Answers

Hire Me
expert
Husnain SaeedComputer science

599 Answers

Hire Me
expert
Atharva PatilComputer science

785 Answers

Hire Me