Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprende Challenge: Age Group Categorizer | R Conditional Statements Tutorial
Control Flow in R

bookChallenge: Age Group Categorizer

Tarea

Swipe to start coding

Write a function that determines the age group for a given age using nested if statements.

  • Return "Child" if the age is less than 13.
  • Return "Teenager" if the age is 13 or greater but less than 20.
  • Return "Adult" if the age is 20 or greater but less than 65.
  • Return "Senior" if the age is 65 or older.

Solución

¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 1. Capítulo 4
single

single

Pregunte a AI

expand

Pregunte a AI

ChatGPT

Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla

close

bookChallenge: Age Group Categorizer

Desliza para mostrar el menú

Tarea

Swipe to start coding

Write a function that determines the age group for a given age using nested if statements.

  • Return "Child" if the age is less than 13.
  • Return "Teenager" if the age is 13 or greater but less than 20.
  • Return "Adult" if the age is 20 or greater but less than 65.
  • Return "Senior" if the age is 65 or older.

Solución

Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 1. Capítulo 4
single

single

some-alt