Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprenda Challenge: Real-World Anonymous Functions | Anonymous Functions in R
Functions and Functional Programming in R

bookChallenge: Real-World Anonymous Functions

Tarefa

Swipe to start coding

Use your knowledge of anonymous functions and lapply to solve a practical data transformation problem.
Write a function capitalize_first that takes a list of names and returns a new list where each name has its first letter capitalized.

  • Use lapply to apply an anonymous function to each element of names_list.
  • The anonymous function should capitalize only the first letter of each name, leaving the rest unchanged.
  • The function must return a list with the transformed names.

Solução

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 2. Capítulo 6
single

single

Pergunte à IA

expand

Pergunte à IA

ChatGPT

Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo

Suggested prompts:

Can you explain that in more detail?

What are the main benefits or drawbacks?

Can you give me an example?

close

bookChallenge: Real-World Anonymous Functions

Deslize para mostrar o menu

Tarefa

Swipe to start coding

Use your knowledge of anonymous functions and lapply to solve a practical data transformation problem.
Write a function capitalize_first that takes a list of names and returns a new list where each name has its first letter capitalized.

  • Use lapply to apply an anonymous function to each element of names_list.
  • The anonymous function should capitalize only the first letter of each name, leaving the rest unchanged.
  • The function must return a list with the transformed names.

Solução

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 2. Capítulo 6
single

single

some-alt