ComeçarComece de graça

map_chr()

In this exercise, you'll dive a bit deeper into the different map_*() variants. The map() function always outputs a list. map_*() outputs other kinds of information. Study the table below and make sure you're clear on the type of output for each map_*() variant.

map_*() Output
map_chr() character vector
map_lgl() logical vector [TRUE or FALSE]
map_int() integer vector
map_dbl() double vector

Este exercício faz parte do curso

Foundations of Functional Programming with purrr

Ver curso

Exercício interativo prático

Experimente este exercício completando este código de exemplo.

# Pull out the director element of sw_films in a list and character vector
map(___, ~.x[["___"]])
map_chr(___, ~.x[["___"]])
Editar e executar o código