knitr::opts_chunk$set(echo = TRUE, collapse = TRUE, comment = "#>") library(fml)
File Management and Location tools
Install the development version from Github with:
## install remotes pkg if not already if (!requireNamespace("remotes", quietly = TRUE)) { install.packages("remotes") } ## install from github remotes::install_github("mkearney/fml")
find_file()
: find a file (exact matches)## find the rtweet readme find_file("rtweet", "README.Rmd")
search_file()
: search for files using wildcard expansion*
: match zero or more characters?
: match a single character[
: begin a character class or range## starts with capital letter and doesn't end with md/html search_file("[A-Z]*[!md|html]") ## all .yml files not in docs/ search_file("[!docs]*.yml") ## .yml files that start with a dot search_file(".*.yml")
here()
: smart file paths within project## locate file in project here("R", "fp.R")
list_files()
: list files## list files in directory list_files(full = FALSE)
list_dirs()
: list directories## list dirs in directory list_dirs(full = FALSE)
list_paths()
: list all paths## list files AND paths in directory list_paths(full = FALSE)
fp()
: construct file path## build this/that fp("this", "that") ## pipe style "this" %FP% "that"
pe()
: path expansion–converts to canonical form## build this/that pe(fp(".", "this", "that")) ## pipe style pe("~" %FP% "this" %FP% "that")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.