Skip to content

Latest commit

 

History

History
15 lines (12 loc) · 208 Bytes

r_functions_snippets.md

File metadata and controls

15 lines (12 loc) · 208 Bytes

Functions

Create a function

my_function <- function(x, y) {
  result <- x + y
  return(result)
}

Apply a function to a column

df$NewColumn <- sapply(df$OldColumn, my_function)