# Miscellaneous Functions to Support Packages Maintained by 'Yihui Xie'

## Documentation for package ‘xfun’ version 0.22

- DESCRIPTION file.
- User guides, package vignettes and other documentation.

## Help Pages

$.xfun_strict_list | Strict lists
as_strict_list | Strict lists
attr | Obtain an attribute of an object without partial matching
base64_decode | Encode/decode data into/from base64 encoding.
base64_encode | Encode/decode data into/from base64 encoding.
base64_uri | Generate the Data URI for a file
bg_process | Start a background process
bump_version | Bump version numbers
cache_rds | Cache the value of an R expression to an RDS file
compare_Rcheck | Run 'R CMD check' on the reverse dependencies of a package
del_empty_dir | Delete an empty directory
dir_create | Create a directory recursively by default
dir_exists | Test the existence of files and directories
download_file | Try various methods to download a file
do_once | Perform a task once in an R session
embed_dir | Embed a file, multiple files, or directory on an HTML page
embed_file | Embed a file, multiple files, or directory on an HTML page
embed_files | Embed a file, multiple files, or directory on an HTML page
exit_call | Call 'on.exit()' in a parent function
file_exists | Test the existence of files and directories
file_ext | Manipulate filename extensions
file_string | Read a text file and concatenate the lines by "\n"
from_root | Get the relative path of a path in a project relative to the current working directory
github_releases | Get the tags of Github releases of a repository
grep_sub | Perform replacement with 'gsub()' on elements matched from 'grep()'
gsub_dir | Search and replace strings in files
gsub_ext | Search and replace strings in files
gsub_file | Search and replace strings in files
gsub_files | Search and replace strings in files
install_dir | Install a source package from a directory
install_github | An alias of 'remotes::install_github()'
in_dir | Evaluate an expression under a specified working directory
isFALSE | Test if an object is identical to 'FALSE'
is_abs_path | Test if paths are relative or absolute
is_ascii | Check if a character vector consists of entirely ASCII characters
is_linux | Test for types of operating systems
is_macos | Test for types of operating systems
is_rel_path | Test if paths are relative or absolute
is_sub_path | Test if a path is a subpath of a dir
is_unix | Test for types of operating systems
is_web_path | Test if a path is a web path
is_windows | Test for types of operating systems
json_vector | A simple JSON serializer
loadable | Attach or load packages, and automatically install missing packages if requested
magic_path | Find a file or directory under a root directory
mark_dirs | Mark some paths as directories
msg_cat | Generate a message with 'cat()'
n2w | Convert numbers to English words
native_encode | Try to use the system native encoding to represent a character vector
normalize_path | Normalize paths
numbers_to_words | Convert numbers to English words
optipng | Run OptiPNG on all PNG files under a directory
parse_only | Parse R code and do not keep the source
pkg_attach | Attach or load packages, and automatically install missing packages if requested
pkg_attach2 | Attach or load packages, and automatically install missing packages if requested
pkg_available | Attach or load packages, and automatically install missing packages if requested
pkg_load | Attach or load packages, and automatically install missing packages if requested
pkg_load2 | Attach or load packages, and automatically install missing packages if requested
print.xfun_raw_string | Print a character vector in its raw form
print.xfun_strict_list | Strict lists
process_file | Read a text file, process the text with a function, and write the text back
proc_kill | Kill a process and (optionally) all its child processes
proj_root | Return the (possible) root directory of a project
prose_index | Find the indices of lines in Markdown that are prose (not code blocks)
protect_math | Protect math expressions in pairs of backticks in Markdown
raw_string | Print a character vector in its raw form
Rcmd | Run the commands 'Rscript' and 'R CMD'
read_bin | Read all records of a binary file as a raw vector by default
read_utf8 | Read / write files encoded in UTF-8
relative_path | Get the relative path of a path relative to a directory
rename_seq | Rename files with a sequential numeric prefix
retry | Retry calling a function for a number of times
rev_check | Run 'R CMD check' on the reverse dependencies of a package
root_rules | Return the (possible) root directory of a project
Rscript | Run the commands 'Rscript' and 'R CMD'
Rscript_call | Call a function in a new R session via 'Rscript()'
rstudio_type | Type a character vector into the RStudio source editor
same_path | Test if two paths are the same after they are normalized
sans_ext | Manipulate filename extensions
session_info | An alternative to sessionInfo() to print session information
set_envvar | Set environment variables
sort_file | Read a text file, process the text with a function, and write the text back
split_lines | Split a character vector by line breaks
split_source | Split source lines into complete expressions
strict_list | Strict lists
stringsAsStrings | Set the global option 'options(stringsAsFactors = FALSE)' inside a parent function and restore the option after the parent function exits
strings_please | Set the global option 'options(stringsAsFactors = FALSE)' inside a parent function and restore the option after the parent function exits
tojson | A simple JSON serializer
tree | Turn the output of 'str()' into a tree diagram
try_silent | Try to evaluate an expression silently
upload_ftp | Upload to an FTP server via 'curl'
upload_win_builder | Upload to an FTP server via 'curl'
url_filename | Extract filenames from a URLs
valid_syntax | Check if the syntax of the code is valid
with_ext | Manipulate filename extensions
write_utf8 | Read / write files encoded in UTF-8