```r
my_func <- function(arg1, arg2, named_arg3 = 42) {
  # Do things with arguments
  # The last statement is the return value
  # you can also use the explicit `return(value)` to do early returns
}
```