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

bookChallenge: Functional Programming Basics

Tâche

Swipe to start coding

Write a function apply_function_to_vector that takes a vector and a function as arguments, and applies the function to each element of the vector, returning the results.

  • The function must accept two arguments: a vector (vec) and a function (fun).
  • The function must apply fun to each element of vec.
  • The function must return a vector containing the results.

Solution

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 3. Chapitre 2
single

single

Demandez à l'IA

expand

Demandez à l'IA

ChatGPT

Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion

Suggested prompts:

Can you explain this in simpler terms?

What are the main takeaways from this?

Can you give me a real-world example?

close

bookChallenge: Functional Programming Basics

Glissez pour afficher le menu

Tâche

Swipe to start coding

Write a function apply_function_to_vector that takes a vector and a function as arguments, and applies the function to each element of the vector, returning the results.

  • The function must accept two arguments: a vector (vec) and a function (fun).
  • The function must apply fun to each element of vec.
  • The function must return a vector containing the results.

Solution

Switch to desktopPassez à un bureau pour une pratique réelleContinuez d'où vous êtes en utilisant l'une des options ci-dessous
Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 3. Chapitre 2
single

single

some-alt