Useful functions for everyday programming.
# From CRAN (stable version)
install.packages("toscutil")
# From Github (development version)
# devtools::install_github("toscm/toscutil")
install.packages("toscutil", repos = c('https://toscm.r-universe.dev', 'https://cloud.r-project.org'))
To use any function or data object, first install the package and then just enter any object's fully qualified name into a running R session, e.g. toscutil::now_ms(). You can find a curated list of existing functions at toscm.github.io/toscutil/reference. Alternatively, you can load the package first, using command library("toscutil") and then access any symbol directly by its name, e.g. now_ms().
Extended versions of base R functions
capture.output2(): Capture output from a commandcat2(): Concatenate and Printcatf(): Format and Printdput2(): Return ASCII representation of an R objectfg(): Foreground Color Codeshelp2(): Return help for topicnamed(): Create automatically named Listnorm_path(): Return Normalized PathFunctions for condition checking
equal(): Test Near Equalityifthen(): Shortcut for multiple if else statementsis.none(): Truth checking as in PythonFunctions for writing functions
caller(): Get Name of Calling Functionfunction_locals(): Get Function Environment as Listlocals(): Get specified Environment as Listsys.exit(): Terminate a non-interactive R SessionFunctions for reading, checking and writing documentation
check_pkg_docs(): Check Documented Functions in a PackageDOCSTRING_TEMPLATE(): Docstring Templatefind_description_file(): Find DESCRIPTION Fileget_docstring(): Get docstring for a Functionget_formals(): Get formals of a Functionget_pkg_docs(): Get Documented Functions in a Packageread_description_file(): Read DESCRIPTION File into a Listsplit_docstring(): Split a docstring into a Head, Param and Tail Partupdate_docstring(): Update docstring for a FunctionFunctions for experimenting in interactive (live) R sessions
corn(): Return Corners of Matrix like Objectsrm_all(): Remove all objects from global environmentstub(): Stub Function Argumentstrace_package(): Traces function calls from a packageuntrace_package(): Untraces function calls from a packageFunctions returning important paths
config_dir(): Get Normalized Configuration Directory Path of a Programconfig_file(): Get Normalized Configuration File Path of a Programdata_dir(): Get Normalized Data Directory Path of a Programgetfd(): Get File Directorygetpd(): Get Project Directoryhome(): Get USERPROFILE or HOMExdg_config_home(): Get XDG_CONFIG_HOMExdg_data_home(): Get XDG_DATA_HOMES3 methods
predict.numeric(): Predict Method for Numeric VectorsFunction returning datetime
now(): Get Current Date and Time as StringFor details on how to contribute to this package, please see CONTRIBUTING.md.