LoslegenKostenlos loslegen

map_*

The map() function will return its output as a list. However, there are several different map() functions; you can use map_*() functions to tell purrr the type of output you want. The * in map_*() represents different R data types. For instance, you might want the output to be a vector of numbers so that we can put it inside a data frame. So, unless you want something to be returned as a list, you need to determine what you want the output to be before you write your map() function.

Diese Übung ist Teil des Kurses

Foundations of Functional Programming with purrr

Kurs anzeigen

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

# Map over wesanderson, to determine the length of each element
map(___, ___)
Code bearbeiten und ausführen