Learn R Programming

⚠️There's a newer version (0.52) of this package.Take me there.

xfun (version 0.34)

Supporting Functions for Packages Maintained by 'Yihui Xie'

Description

Miscellaneous functions commonly used in other packages maintained by 'Yihui Xie'.

Copy Link

Version

Install

install.packages('xfun')

Monthly Downloads

1,311,479

Version

0.34

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Yihui Xie

Last Published

October 18th, 2022

Functions in xfun (0.34)

bump_version

Bump version numbers
bg_process

Start a background process
broken_packages

Find out broken packages and reinstall them
Rscript_call

Call a function in a new R session via Rscript()
attr

Obtain an attribute of an object without partial matching
base64_encode

Encode/decode data into/from base64 encoding.
base_pkgs

Get base R package names
base64_uri

Generate the Data URI for a file
embed_file

Embed a file, multiple files, or directory on an HTML page
dir_create

Create a directory recursively by default
exit_call

Call on.exit() in a parent function
download_file

Try various methods to download a file
del_empty_dir

Delete an empty directory
dir_exists

Test the existence of files and directories
existing_files

Find file paths that exist
cache_rds

Cache the value of an R expression to an RDS file
do_once

Perform a task once in an R session
crandalf_check

Submit check jobs to crandalf
file_ext

Manipulate filename extensions
from_root

Get the relative path of a path in a project relative to the current working directory
format_bytes

Format numbers of bytes using a specified unit
file_string

Read a text file and concatenate the lines by '\n'
in_dir

Evaluate an expression under a specified working directory
magic_path

Find a file or directory under a root directory
gsub_file

Search and replace strings in files
is_web_path

Test if a path is a web path
github_releases

Get the tags of Github releases of a repository
is_ascii

Check if a character vector consists of entirely ASCII characters
is_abs_path

Test if paths are relative or absolute
grep_sub

Perform replacement with gsub() on elements matched from grep()
isFALSE

Test if an object is identical to FALSE
is_R_CMD_check

Some utility functions for checking packages
install_github

An alias of remotes::install_github()
install_dir

Install a source package from 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
is_blank

Test if a character vector consists of blank strings
native_encode

Try to use the system native encoding to represent a character vector
is_sub_path

Test if a path is a subpath of a dir
normalize_path

Normalize paths
optipng

Run OptiPNG on all PNG files under a directory
is_windows

Test for types of operating systems
proj_root

Return the (possible) root directory of a project
numbers_to_words

Convert numbers to English words
proc_kill

Kill a process and (optionally) all its child processes
process_file

Read a text file, process the text with a function, and write the text back
mark_dirs

Mark some paths as directories
rename_seq

Rename files with a sequential numeric prefix
msg_cat

Generate a message with cat()
rest_api

Get data from a REST API
relative_path

Get the relative path of a path relative to a directory
read_utf8

Read / write files encoded in UTF-8
news2md

Convert package news to the Markdown format
read_all

Read all text files and concatenate their content
prose_index

Find the indices of lines in Markdown that are prose (not code blocks)
strict_list

Strict lists
split_source

Split source lines into complete expressions
protect_math

Protect math expressions in pairs of backticks in Markdown
raw_string

Print a character vector in its raw form
retry

Retry calling a function for a number of times
rev_check

Run R CMD check on the reverse dependencies of a package
split_lines

Split a character vector by line breaks
shrink_images

Shrink images to a maximum width
stringsAsStrings

Set the global option options(stringsAsFactors = FALSE) inside a parent function and restore the option after the parent function exits
submit_cran

Submit a source package to CRAN
tinify

Use the Tinify API to compress PNG and JPEG images
system3

Run system2() and mark its character output as UTF-8 if appropriate
read_bin

Read all records of a binary file as a raw vector by default
session_info

An alternative to sessionInfo() to print session information
rstudio_type

Type a character vector into the RStudio source editor
try_error

Try an expression and see if it throws an error
url_filename

Extract filenames from a URLs
set_envvar

Set environment variables
valid_syntax

Check if the syntax of the code is valid
try_silent

Try to evaluate an expression silently
same_path

Test if two paths are the same after they are normalized
tojson

A simple JSON serializer
tree

Turn the output of str() into a tree diagram
url_accessible

Test if a URL is accessible
upload_ftp

Upload to an FTP server via curl
Rscript

Run the commands Rscript and R CMD
alnum_id

Generate ID strings