Advertisement
elena1234

Anonymous function with sapply()

Apr 12th, 2022 (edited)
1,447
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
R 0.08 KB | None | 0 0
  1. v <- c(1, 2, 3, 4, 5)
  2. result <- sapply(v , function(num) num + 1)
  3. print(result)
  4.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement