Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lernen Challenge: Functional Programming Basics | Functional Programming in Practice
Functions and Functional Programming in R

bookChallenge: Functional Programming Basics

Aufgabe

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.

Lösung

War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 3. Kapitel 2
single

single

Fragen Sie AI

expand

Fragen Sie AI

ChatGPT

Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen

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

Swipe um das Menü anzuzeigen

Aufgabe

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.

Lösung

Switch to desktopWechseln Sie zum Desktop, um in der realen Welt zu übenFahren Sie dort fort, wo Sie sind, indem Sie eine der folgenden Optionen verwenden
War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 3. Kapitel 2
single

single

some-alt