Iterating over Several Vectors at Once in R: MAGIC & purrr

Поделиться
HTML-код
  • Опубликовано: 21 авг 2024
  • It's fun to use magic in programming! Here, we use magic two-fold: applying the magic of the purrr package, and using magic numbers to generate meaningful messages from random samples of letters and numbers. Enjoy!
    Contents: direct code - user defined function - iterating via lapply() - map() - map2() - pmap()
    purrr is a powerful tool for your functional programming toolkit.
    Code used in presentation (xaringan, based on R Markdown):
    github.com/fjo...
    Find out more about purrr:
    RStudio Cheat Sheet at Help - Cheat Sheets - List Manipulation with purrr
    R for Data Science (R4DS), chapter 21: Iteration
    r4ds.had.co.nz/
    Jenny Bryan / R package repurrrsive
    github.com/jen...
    jennybc.github...
    Charlotte Wickham
    github.com/cwi...
    www.rstudio.co...
    Colin Fay: Vous allez aimer avoir {purrr} (French pun, English article)
    colinfay.me/ha...
    Contact me, e. g. to discuss (online) R workshops / trainings / webinars:
    / wolfriepl
    Facebook: / statistikdresden
    Twitter: / statistikindd
    statistik-dres...
    R Workshops: statistik-dres...
    Blog (German, translate option): statistik-dres...
    Playlist: Music chart history
    • Music Chart History

Комментарии • 2