Map() function in R


Could you please explain, which is the main reason, why we use map() function, as technically we can make new columns using mutate() function without map()? Is the only reason to make our code shorter and more readable?

I don’t think so. Actually mutate() is mainly used to work on data.frames only, and map() is designed to work on every kind of lists. Data.frames being lists, you can also use map() for iterating on a data.frame.

If you find this helpful , please mark it as a solution.Thank you.