Title: | A Suite of High-Performance Packages for Statistics and Data Manipulation |
---|---|
Description: | Easy installation, loading and management, of high-performance packages for statistical computing and data manipulation in R. The core 'fastverse' consists of 4 packages: 'data.table', 'collapse', 'kit' and 'magrittr', that jointly only depend on 'Rcpp'. The 'fastverse' can be freely and permanently extended with additional packages, both globally or for individual projects. Separate package verses can also be created. Fast packages for many common tasks such as time series, dates and times, strings, spatial data, statistics, data serialization, larger-than-memory processing, and compilation of R code are listed in the README file: <https://github.com/fastverse/fastverse#suggested-extensions>. |
Authors: | Sebastian Krantz [aut, cre], Hadley Wickham [ctb] |
Maintainer: | Sebastian Krantz <[email protected]> |
License: | GPL-3 |
Version: | 0.3.4 |
Built: | 2024-12-08 07:15:28 UTC |
Source: | CRAN |
The fastverse is an extensible suite of R packages, developed independently by various people, that jointly contribute to the objectives of:
Speeding up R through heavy use of compiled code (C, C++, Fortran)
Enabling more complex statistical and data manipulation operations in R
Reducing the number of dependencies required for advanced computing in R
Inspired by the tidyverse
package, the fastverse
package is a flexible package loader and manager
that allows users to put together their own 'verses' of packages and load them with library(fastverse)
.
fastverse
installs 4 core packages (data.table
, collapse
, kit
and magrittr
) that
provide native C/C++ code of proven quality, work well together, and enable complex statistical computing and data manipulation - with only Rcpp
as an additional dependency.
fastverse
also allows users to freely (and permanently) extend or reduce the number of packages in the fastverse.
An overview of high-performing packages for various common tasks is provided in the README file.
An overview of the package and the different ways to extend the fastverse is provided in the vignette.
fastverse
PackageFunctions to extend or reduce the number of packages in the fastverse - either for the session or permanently - and to restore defaults.
fastverse_extend()
fastverse_detach()
fastverse_reset()
Function to display conflicts for fastverse packages (or any other attached packages)
Function to update fastverse packages (and dependencies) and install (missing) packages
fastverse_update()
fastverse_install()
Utilities to retrieve the names of fastverse packages (and dependencies), their update status, and produce a situation report
fastverse_packages()
fastverse_deps()
fastverse_sitrep()
Function to create a fully separate extensible meta-package/verse like fastverse
options(fastverse.quiet = TRUE)
will disable all automatic messages (including conflict reporting) when calling library(fastvsers)
, fastverse_extend
, fastverse_update(install = TRUE)
and fastverse_install
.
options(fastverse.styling = FALSE)
will disable all styling applied to text printed to the console.
options(fastverse.extend = c(...))
can be set before calling library(fastvsers)
to extend the fastverse with some packages for the session. The same can be done with the
fastverse_extend
function after library(fastvsers)
, which will also populate options("fastverse.extend")
.
options(fastverse.install = TRUE)
can be set before library(fastverse)
to install any missing packages beforehand. See also fastverse_install
.
There are 3 internal clashes between collapse::funique
and kit::funique
, collapse::fduplicated
and kit::fduplicated
, and collapse::fdroplevels
and data.table::fdroplevels
.
The collapse versions take precedence in all cases as they provide greater performance.
Creates and installs a fully customizable descendant verse of packages that is itself extensible and inherits 90%
of the functionality of the fastverse
package.
fastverse_child( name, title, pkg, maintainer, version = "0.1.0", dir = ".", theme = c("fastverse", "tidyverse"), install = TRUE, keep.dir = TRUE, ... )
fastverse_child( name, title, pkg, maintainer, version = "0.1.0", dir = ".", theme = c("fastverse", "tidyverse"), install = TRUE, keep.dir = TRUE, ... )
name |
character. The name of the child-verse e.g. 'myMLverse'. |
title |
character. The title of the child-verse e.g. 'My Machine Learning Verse'. |
pkg |
character. A vector of core packages for the new verse. |
maintainer |
character. A quoted |
version |
character. A quoted version number for the new package. |
dir |
character. The directory in which a source directory dir/name for the package will be created. |
theme |
character. Set the colour-theme for text printed to the console. The options are |
install |
logical. |
keep.dir |
logical. |
... |
further arguments to |
This function creates and installs a source package according to the users specification. For that it downloads the 'child' branch of the GitHub repository, which was specifically set up to produce a new verse, unzips it into a source directory, and substitutes the user inputs into the files. The package is then installed from source, and (optionally) the source directory is removed again.
fastverse children inherit 90% of the functionality of the fastverse package: they are not permanently globally extensible and can not bear children themselves,
but can be configured for projects (using a .name
config file) and extended in the session.
Use of this function requires an internet connection but no additional R packages (like devtools
, remotes
or roxygen2
).
fastverse_child
returns NULL
invisibly.
## Not run: fastverse_child( name = "tsverse", title = "Time Series Package Verse", pkg = c("xts", "roll", "zoo", "tsbox", "urca", "tseries", "tsutils", "forecast"), maintainer = 'person("GivenName", "FamilyName", role = "cre", email = "[email protected]")', dir = "C:/Users/.../Documents", theme = "tidyverse") ## End(Not run)
## Not run: fastverse_child( name = "tsverse", title = "Time Series Package Verse", pkg = c("xts", "roll", "zoo", "tsbox", "urca", "tseries", "tsutils", "forecast"), maintainer = 'person("GivenName", "FamilyName", role = "cre", email = "[email protected]")', dir = "C:/Users/.../Documents", theme = "tidyverse") ## End(Not run)
This function lists all the conflicts among fastverse packages and between fastverse packages and other attached packages. It can also be used to check conflicts for any other attached packages.
fastverse_conflicts(pkg = fastverse_packages())
fastverse_conflicts(pkg = fastverse_packages())
pkg |
character. A vector of packages to check conflicts for. The default is all fastverse packages. |
There are 3 internal conflicts in the core fastverse which are not displayed by fastverse_conflicts()
:
collapse::funique
and collapse::fdupliacted
mask kit::funique
and kit::fduplicated
. If both packages are detached, collapse is attached after kit. In general, the
collapse versions are faster and a bit more versatile. The kit versions are also very fast and additionally supports matrices!
collapse::fdroplevels masks data.table::fdroplevels
. The former is faster and supports arbitrary data structures, whereas the latter has options to exclude certain levels from being dropped.
An object of class 'fastverse_conflicts': A named list of character vectors where the names are the conflicted objects, and the
content are the names of the package namespaces containing the object, in the order they appear on the search
path.
# Check conflicts between fastverse packages and all attached packages fastverse_conflicts() # Check conflicts among all attached packages fastverse_conflicts(rm_stub(search()[-1], "package:"))
# Check conflicts between fastverse packages and all attached packages fastverse_conflicts() # Check conflicts among all attached packages fastverse_conflicts(rm_stub(search()[-1], "package:"))
Lists all fastverse dependencies and the local and repository (e.g. CRAN) versions of packages and dependencies.
fastverse_deps( pkg = fastverse_packages(), recursive = FALSE, repos = getOption("repos"), include.self = FALSE, check.deps = TRUE )
fastverse_deps( pkg = fastverse_packages(), recursive = FALSE, repos = getOption("repos"), include.self = FALSE, check.deps = TRUE )
pkg |
character vector of packages to check dependencies and versions of. The default is all fastverse packages. |
recursive |
logical. |
repos |
character vector. Base URL(s) of the repositories to use, e.g., the URL of a CRAN mirror such as |
include.self |
logical. |
check.deps |
logical. |
A data frame giving the package names, the repository and local version, and a logical variable stating whether the local version is behind the repository version.
Detaches (fastverse) packages, removing them from the search
path.
fastverse_detach( ..., unload = FALSE, force = FALSE, include.self = TRUE, session = FALSE, permanent = FALSE )
fastverse_detach( ..., unload = FALSE, force = FALSE, include.self = TRUE, session = FALSE, permanent = FALSE )
... |
comma-separated package names, quoted or unquoted, or vectors of package names. If left empty, all packages returned by |
unload |
logical. |
force |
logical. should a fastverse package be detached / unloaded even though other attached packages depend on it? |
include.self |
logical. |
session |
logical. |
permanent |
logical. if |
fastverse_detach
returns NULL
invisibly.
Loads additional packages as part of the fastverse. By default only for the session, but extensions can be saved up to reinstallation/updating of the fastverse package.
fastverse_extend( ..., install = FALSE, permanent = FALSE, check.conflicts = !isTRUE(getOption("fastverse.quiet")), topics = NULL, repos = getOption("repos") )
fastverse_extend( ..., install = FALSE, permanent = FALSE, check.conflicts = !isTRUE(getOption("fastverse.quiet")), topics = NULL, repos = getOption("repos") )
... |
comma-separated package names, quoted or unquoted, or vectors of package names. |
install |
logical. Install packages not available? |
permanent |
logical. Should packages be saved and included when |
check.conflicts |
logical. Should conflicts between extension packages and attached packages be checked? |
topics |
depreciated argument used to bulk-attach or install suggested extension packages prior to v0.3.0. |
repos |
character vector. Base URL(s) of the repositories to use, e.g., the URL of a CRAN mirror such as |
The fastverse can be extended using a free choice of packages. An overview of high-performing packages for various tasks is provided in the README file.
When the fastverse is extended calling fastverse_extend(...)
, the packages that are not attached are attached, but conflicts are checked for all specified packages.
If permanent = FALSE
, an options("fastverse.extend")
is set which stores these extension packages, regardless of whether they were already attached or not. When calling
fastverse_packages
, fastverse_deps
, fastverse_conflicts
, fastverse_update
, fastverse_sitrep
or fastverse_detach
, these packages are included as part of the fastverse.
This is also the case if permanent = TRUE
, with the only difference that instead of populating the option, a file is saved to the package directory such that the packages are also loaded
(as part of the core fastverse) when calling library(fastverse)
in the next session. To extend the fastverse for the current session when it is not yet loaded, users can also set options(fastverse.extend = c(...))
, where c(...)
is a character vector of package names, before calling library(fastverse)
.
fastverse_extend
returns NULL
invisibly.
# fastverse_extend(xts, stringi, fasttime)
# fastverse_extend(xts, stringi, fasttime)
This function (by default) checks if any fastverse package is missing and installs the missing package(s). The development versions of fastverse packages can also be installed from r-universe. The link to the repository is contained in the .fastverse_repos
macro.
fastverse_install( ..., only.missing = TRUE, install = TRUE, repos = getOption("repos") )
fastverse_install( ..., only.missing = TRUE, install = TRUE, repos = getOption("repos") )
... |
comma-separated package names, quoted or unquoted, or vectors of package names. If left empty, all packages returned by |
only.missing |
logical. |
install |
logical. |
repos |
character vector. Base URL(s) of the repositories to use, e.g., the URL of a CRAN mirror such as |
fastverse_install
returns NULL
invisibly.
There is also the possibility to set options(fastverse.install = TRUE)
before library(fastverse)
, which will call fastverse_install()
before loading any packages to make sure all packages are available.
If you are using a .fastverse
configuration file inside a project (see vignette), you can also place _opt_fastverse.install = TRUE
before the list of packages in that file.
Core packages are first fetched from a project-level configuration file (if found), else from a global configuration file (if found),
otherwise the standard set of core packages is returned. In addition, if extensions = TRUE
, any packages used to extend the fastverse for the current
session (fetched from getOption("fastverse.extend")
) are also returned.
fastverse_packages(extensions = TRUE, include.self = TRUE)
fastverse_packages(extensions = TRUE, include.self = TRUE)
extensions |
logical. |
include.self |
logical. Include the fastverse package in the list? |
A character vector of package names.
fastverse_packages()
fastverse_packages()
Calling this function will remove global configuration files and (default) clear all package options. Attached packages will not be detached, and configuration files for projects (as discussed in the vignette) will not be removed.
fastverse_reset(options = TRUE)
fastverse_reset(options = TRUE)
options |
logical. |
fastverse_reset
returns NULL
invisibly.
This function gives a quick overview of the version of R and all fastverse packages (including availability updates for packages) and indicates whether any global or project-level configuration files are used (as described in more detail the vignette).
fastverse_sitrep(...)
fastverse_sitrep(...)
... |
arguments other than |
fastverse_sitrep
returns NULL
invisibly.
This will check all fastverse packages (and their dependencies) for updates and (optionally) install those updates.
fastverse_update(..., install = FALSE, repos = getOption("repos"))
fastverse_update(..., install = FALSE, repos = getOption("repos"))
... |
arguments passed to |
install |
logical. |
repos |
character vector. Base URL(s) of the repositories to use, e.g., the URL of a CRAN mirror such as |
fastverse_update
returns NULL
invisibly.
## Not run: ## Update from CRAN fastverse_update() ## Update from R-Universe (development versions) fastverse_update(repos = .fastverse_repos) ## End(Not run)
## Not run: ## Update from CRAN fastverse_update() ## Update from R-Universe (development versions) fastverse_update(repos = .fastverse_repos) ## End(Not run)
Checks if packages are installed or attached.
is_attached(x) is_installed(x)
is_attached(x) is_installed(x)
x |
character. A vector of package names. |
A named logical vector.