Advertisement
elena1234

Anonymous function with sapply()

Apr 12th, 2022 (edited)
593
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. v <- c(1, 2, 3, 4, 5)
  2. result <- sapply(v , function(num) num + 1)
  3. print(result)
  4.  
Advertisement
RAW Paste Data Copied
Advertisement