Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprende Challenge: Create an Anonymous Function | Anonymous Functions in R
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
Functions and Functional Programming in R

bookChallenge: Create an Anonymous Function

Tarea

Swipe to start coding

Write three anonymous functions in R and assign them to variables as described below:

  • Create an anonymous function that adds 3 to its input and assign it to the variable add_three.
  • Create an anonymous function that returns TRUE if a number is even, and assign it to the variable is_even.
  • Create an anonymous function that concatenates two strings (with no separator), and assign it to the variable concat_strings.

Each function should be assigned to the specified variable name. Do not use named function definitions for this task.

Solución

¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 2. Capítulo 2
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

Suggested prompts:

Can you explain this in simpler terms?

What are the main points I should remember?

Can you give me an example?

close

bookChallenge: Create an Anonymous Function

Desliza para mostrar el menú

Tarea

Swipe to start coding

Write three anonymous functions in R and assign them to variables as described below:

  • Create an anonymous function that adds 3 to its input and assign it to the variable add_three.
  • Create an anonymous function that returns TRUE if a number is even, and assign it to the variable is_even.
  • Create an anonymous function that concatenates two strings (with no separator), and assign it to the variable concat_strings.

Each function should be assigned to the specified variable name. Do not use named function definitions for this task.

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 2. Capítulo 2
single

single

some-alt