Identifying influencers
1. Identifying influencers
You've almost reached the end of this course. Wanna stay with us just a little bit longer?2. map_at()
In this lesson, we'll be modifying map_at(). This variant of map() is used when you want to run a function at a specific location in a list. Note that the entire list is returned, with only the element specified in the dot at modified. This way, you can iterate over a list, and modify a specific element inside this list. You'll get the same list back, but with targeted modifications. With map_at(), you can either use a name to refer to the name of the element or a number, to refer to the position of the element.3. negate()
Finally, the last function from purrr we will see in this last exercise is negate(). This function that we have seen in the previous chapters is used to invert the value of a predicate. In other words, if you pass to negate() a function that tests for something, the negated function will test for the opposite. For example, in this slide, we are negating the is.character() function from base R, which tests if something is a character vector. With negate(), the newly created function will test if the element is not a character vector.4. Let's practice!
Are you ready for the last exercises of this course?Create Your Free Account
or
By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.