If you are writing a short function that’s needed only temporarily, a quick-and-dirty way to do this is to write it on the spot, right there in your interactive terminal session. Here’s an example:
> g <- function(x) {
+ return(x+1)
+ }
You are currently reading a PREVIEW of this book.
Get instant access to over
$1 million worth of books and videos.