Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

watch

Watch a directory for changes (additions, deletions & modifications).


Description

This is used to power the auto_test() and auto_test_package() functions which are used to rerun tests whenever source code changes.

Usage

watch(path, callback, pattern = NULL, hash = TRUE)

Arguments

path

character vector of paths to watch. Omit trailing backslash.

callback

function called everytime a change occurs. It should have three parameters: added, deleted, modified, and should return TRUE to keep watching, or FALSE to stop.

pattern

file pattern passed to dir()

hash

hashes are more accurate at detecting changes, but are slower for large files. When FALSE, uses modification time stamps

Details

Use Ctrl + break (windows), Esc (mac gui) or Ctrl + C (command line) to stop the watcher.


testthat

Unit Testing for R

v3.0.2
MIT + file LICENSE
Authors
Hadley Wickham [aut, cre], RStudio [cph, fnd], R Core team [ctb] (Implementation of utils::recover())
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.