stevensanderson,
@stevensanderson@mstdn.social avatar

The map() function applies a function across vectors, lists, or data frames efficiently. Syntax: map(.x, .f, ...) where .x is data, .f is function, ... for extra args. Examples: square vector elements via ~.x^2, get means of column across list of data frames with ~mean(.x$y), apply custom functions to rows/cols like df$z <- map_dbl(df, add_cols).

#R

Post: https://www.spsanderson.com/steveondata/posts/2023-03-26/

image/png
image/png

  • All
  • Subscribed
  • Moderated
  • Favorites
  • FunctionalProgramming
  • ethstaker
  • DreamBathrooms
  • cubers
  • mdbf
  • everett
  • magazineikmin
  • Durango
  • Youngstown
  • rosin
  • slotface
  • modclub
  • kavyap
  • GTA5RPClips
  • ngwrru68w68
  • JUstTest
  • thenastyranch
  • cisconetworking
  • khanakhh
  • osvaldo12
  • InstantRegret
  • Leos
  • tester
  • tacticalgear
  • normalnudes
  • provamag3
  • anitta
  • megavids
  • lostlight
  • All magazines