Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Вивчайте Challenge: Real-World Anonymous Functions | Anonymous Functions in R
Functions and Functional Programming in R

bookChallenge: Real-World Anonymous Functions

Завдання

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.

Рішення

Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 2. Розділ 6
single

single

Запитати АІ

expand

Запитати АІ

ChatGPT

Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат

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

Свайпніть щоб показати меню

Завдання

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.

Рішення

Switch to desktopПерейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 2. Розділ 6
single

single

some-alt