Discussion
Loading...

Post

  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
𝚖𝚊𝚌𝚔𝚊 𝚜𝚣𝚎𝚌𝚑𝚗𝚘
@mackaszechno.bsky.social@bsky.brid.gy  ·  activity timestamp 7 days ago

Never really liked the old-style anonymous functions using ~ and . and .x. New style makes much more sense to me. #rstats

replace specific character with na

fecking bracket placement important

1. old style

mutate(across(site:fuel, ~ifelse(. == "[x]", NA, .)))

2. new style

mutate(across(site:fuel, (x) ifelse(x == "[x]", NA, x)))

and repeated using set_units on character column

d |> mutate(across(start:end, (x) x |> as.integer() |> set_units("Year")))

  • Copy link
  • Flag this post
  • Block
Log in

Kakapo Social

Kakapo Social: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.0 no JS en
Automatic federation enabled
  • Explore
  • About
  • Members
  • Code of Conduct
Home
Login