Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Leer Challenge: Create an Anonymous Function | Anonymous Functions in R
Functions and Functional Programming in R

bookChallenge: Create an Anonymous Function

Taak

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.

Oplossing

Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 2. Hoofdstuk 2
single

single

Vraag AI

expand

Vraag AI

ChatGPT

Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.

close

bookChallenge: Create an Anonymous Function

Veeg om het menu te tonen

Taak

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.

Oplossing

Switch to desktopSchakel over naar desktop voor praktijkervaringGa verder vanaf waar je bent met een van de onderstaande opties
Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 2. Hoofdstuk 2
single

single

some-alt