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

bookChallenge: Functional Programming Basics

Opgave

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øsning

Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 3. Kapitel 2
single

single

Spørg AI

expand

Spørg AI

ChatGPT

Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat

close

bookChallenge: Functional Programming Basics

Stryg for at vise menuen

Opgave

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øsning

Switch to desktopSkift til skrivebord for at øve i den virkelige verdenFortsæt der, hvor du er, med en af nedenstående muligheder
Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 3. Kapitel 2
single

single

some-alt