Skip to content

Instantly share code, notes, and snippets.

@munozedg
munozedg / rs.r
Created February 17, 2022 08:50 — forked from klmr/rs.r
A versatile re-source file function for R
#' (Re-)source parts of a file
#'
#' \code{rs} loads, parses and executes parts of a file as if entered into the R
#' console directly (but without implicit echoing).
#'
#' @param filename character string of the filename to read from. If missing,
#' use the last-read filename.
#' @param from first line to parse.
#' @param to last line to parse.
#' @return the value of the last evaluated expression in the source file.