<!DOCTYPE html>
<!-- Generated by pkgdown: do not edit by hand --><html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="fastverse">
<title>Introduction to the *fastverse* • fastverse</title>
<!-- favicons --><link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png">
<link rel="icon" type="image/png" sizes="32x32" href="../favicon-32x32.png">
<link rel="apple-touch-icon" type="image/png" sizes="180x180" href="../apple-touch-icon.png">
<link rel="apple-touch-icon" type="image/png" sizes="120x120" href="../apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" type="image/png" sizes="76x76" href="../apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" type="image/png" sizes="60x60" href="../apple-touch-icon-60x60.png">
<script src="../deps/jquery-3.6.0/jquery-3.6.0.min.js"></script><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link href="../deps/bootstrap-5.2.2/bootstrap.min.css" rel="stylesheet">
<script src="../deps/bootstrap-5.2.2/bootstrap.bundle.min.js"></script><!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous">
<!-- bootstrap-toc --><script src="https://cdn.jsdelivr.net/gh/afeld/bootstrap-toc@v1.0.1/dist/bootstrap-toc.min.js" integrity="sha256-4veVQbu7//Lk5TSmc7YV48MxtMy98e26cf5MrgZYnwo=" crossorigin="anonymous"></script><!-- headroom.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script><!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script><!-- search --><script src="https://cdnjs.cloudflare.com/ajax/libs/fuse.js/6.4.6/fuse.js" integrity="sha512-zv6Ywkjyktsohkbp9bb45V6tEMoWhzFzXis+LrMehmJZZSys19Yxf1dopHx7WzIKxr5tK2dVcYmaCk2uqdjF4A==" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/autocomplete.js/0.38.0/autocomplete.jquery.min.js" integrity="sha512-GU9ayf+66Xx2TmpxqJpliWbT5PiGYxpaG8rfnBEk1LL8l1KGkRShhngwdXK1UgqhAzWpZHSiYPc09/NwDQIGyg==" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mark.js/8.11.1/mark.min.js" integrity="sha512-5CYOlHXGh6QpOFA/TeTylKLWfB3ftPsde7AnmhuitiTX4K5SqCLBeKro6sPS8ilsz1Q4NRx3v8Ko2IBiszzdww==" crossorigin="anonymous"></script><!-- pkgdown --><script src="../pkgdown.js"></script><meta property="og:title" content="Introduction to the *fastverse*">
<meta property="og:description" content="fastverse">
<meta property="og:image" content="/logo.png">
<!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
    <a href="#main" class="visually-hidden-focusable">Skip to contents</a>
    

    <nav class="navbar fixed-top navbar-light navbar-expand-lg bg-light"><div class="container">
    
    <a class="navbar-brand me-2" href="../index.html">fastverse</a>

    <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Released version">0.3.2</small>

    
    <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
      <span class="navbar-toggler-icon"></span>
    </button>

    <div id="navbar" class="collapse navbar-collapse ms-3">
      <ul class="navbar-nav me-auto">
<li class="nav-item">
  <a class="nav-link" href="../reference/index.html">Reference</a>
</li>
<li class="active nav-item">
  <a class="nav-link" href="../articles/index.html">Articles</a>
</li>
<li class="nav-item">
  <a class="nav-link" href="../news/index.html">News</a>
</li>
      </ul>
<form class="form-inline my-2 my-lg-0" role="search">
        <input type="search" class="form-control me-sm-2" aria-label="Toggle navigation" name="search-input" data-search-index="../search.json" id="search-input" placeholder="Search for" autocomplete="off">
</form>

      <ul class="navbar-nav">
<li class="nav-item">
  <a class="external-link nav-link" href="https://github.com/fastverse/fastverse/" aria-label="github">
    <span class="fab fa fab fa-github fa-lg"></span>
     
  </a>
</li>
      </ul>
</div>

    
  </div>
</nav><div class="container template-article">




<div class="row">
  <main id="main" class="col-md-9"><div class="page-header">
      <img src="../logo.png" class="logo" alt=""><h1>Introduction to the *fastverse*</h1>
            <h3 data-toc-skip class="subtitle">An Extensible Suite of
High-Performance and Low Dependency Packages for Statistical Computing
and Data Manipulation in R</h3>
                        <h4 data-toc-skip class="author">Sebastian
Krantz</h4>
            
            <h4 data-toc-skip class="date">2023-09-19</h4>
      
      <small class="dont-index">Source: <a href="https://github.com/fastverse/fastverse/blob/HEAD/vignettes/fastverse_intro.Rmd" class="external-link"><code>vignettes/fastverse_intro.Rmd</code></a></small>
      <div class="d-none name"><code>fastverse_intro.Rmd</code></div>
    </div>

    
    
<p>The <em>fastverse</em> is an extensible suite of R packages,
developed independently by various people, that contribute to the
objectives of:</p>
<ul>
<li>Speeding up R through heavy use of compiled code (C, C++,
Fortran)</li>
<li>Enabling more complex statistical and data manipulation operations
in R</li>
<li>Reducing the number of dependencies required for advanced computing
in R</li>
</ul>
<p>The <em>fastverse</em> installs 4 core packages (<em>data.table</em>,
<em>collapse</em>, <em>kit</em> and <em>magrittr</em>)<a class="footnote-ref" tabindex="0" data-bs-toggle="popover" data-bs-content="&lt;p&gt;Before v0.3.0 &lt;em&gt;matrixStats&lt;/em&gt; and &lt;em&gt;fst&lt;/em&gt; were
past of the core &lt;em&gt;fastverse&lt;/em&gt;, but were removed following a poll
on Twitter in November 2022 where more than 50% voted in favor of
removing them from the core &lt;em&gt;fastverse&lt;/em&gt;.&lt;/p&gt;"><sup>1</sup></a> that are (by default)
attached with <code><a href="https://fastverse.github.io/fastverse/" class="external-link">library(fastverse)</a></code>. These packages were
selected because they provide high quality compiled code for most common
statistical and data manipulation tasks, have carefully managed APIs,
jointly depend only on base R and <em>Rcpp</em>, and work remarkably
well together.</p>
<div class="sourceCode" id="cb1"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">library</a></span><span class="op">(</span><span class="va"><a href="https://fastverse.github.io/fastverse/" class="external-link">fastverse</a></span><span class="op">)</span></span>
<span><span class="co"># -- Attaching packages --------------------------------------- fastverse 0.3.2 --</span></span>
<span><span class="co"># v data.table 1.14.8         v kit        0.0.13    </span></span>
<span><span class="co"># v magrittr   2.0.3          v collapse   1.9.6.9500</span></span></code></pre></div>
<p>The <em>fastverse</em> package then provides functionality familiar
from the <em>tidyverse</em> package, such as checking and reporting
namespace clashes, and utilities for updating packages, listing
dependencies etc…</p>
<div class="sourceCode" id="cb2"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="co"># Checking for any updates</span></span>
<span><span class="fu"><a href="../reference/fastverse_update.html">fastverse_update</a></span><span class="op">(</span><span class="op">)</span></span>
<span><span class="co"># The following packages are out of date:</span></span>
<span><span class="co"># </span></span>
<span><span class="co">#  * kit (0.0.13 -&gt; 0.0.14)</span></span>
<span><span class="co"># </span></span>
<span><span class="co"># Start a clean R session then run:</span></span>
<span><span class="co"># install.packages("kit")</span></span></code></pre></div>
<p>A key feature of the <em>fastverse</em> is that it can be extended
with other packages that can easily be loaded into the current session
and then managed using the tools this package provides. <!-- 
While placing a clear emphasis on high-quality, high-performance and low-dependency code, as well as statistical rigor and broad based compatibility with the classes and objects most used in R - which warranted a selection of core packages and a number of [suggested extensions](<https://fastverse.github.io/fastverse/#suggested-extensions>) - the *fastverse* is not particularly opinionated about coding style, function nomenclature, or the format of inputs and outputs. -->
Users are also encouraged to make of use the features described in the
remainder of this vignette to permanently extend the <em>fastverse</em>
or even create ‘verses’ of packages that suit their personal analysis
needs. A selection of <a href="https://fastverse.github.io/fastverse/#suggested-extensions" class="external-link">suggested
packages</a> is provided on the website<a class="footnote-ref" tabindex="0" data-bs-toggle="popover" data-bs-content="&lt;p&gt;Let me know about other packages you think should be
featured there.&lt;/p&gt;"><sup>2</sup></a>.</p>
<!-- These extensions can then be loaded and managed by the *fastverse* package, just like the core packages. -->
<div class="section level2">
<h2 id="extending-the-fastverse-for-the-session">Extending the <em>fastverse</em> for the Session<a class="anchor" aria-label="anchor" href="#extending-the-fastverse-for-the-session"></a>
</h2>
<p>After the core packages have been attached with
<code><a href="https://fastverse.github.io/fastverse/" class="external-link">library(fastverse)</a></code>, it is possible to extend the
<em>fastverse</em> for the current session by adding any number of
additional packages with <code><a href="../reference/fastverse_extend.html">fastverse_extend()</a></code>. This will
attach the packages, displaying the package versions (useful for
replicability), and (by default) check for namespace clashes with
attached packages, as well as among the added packages.</p>
<div class="sourceCode" id="cb3"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="co"># Extend the fastverse for the session</span></span>
<span><span class="fu"><a href="../reference/fastverse_extend.html">fastverse_extend</a></span><span class="op">(</span><span class="va">xts</span>, <span class="va">roll</span>, <span class="va">fasttime</span><span class="op">)</span></span>
<span><span class="co"># -- Attaching extension packages ----------------------------- fastverse 0.3.2 --</span></span>
<span><span class="co"># v xts      0.13.1     v fasttime 1.1.0 </span></span>
<span><span class="co"># v roll     1.1.6</span></span>
<span><span class="co"># -- Conflicts ------------------------------------------ fastverse_conflicts() --</span></span>
<span><span class="co"># x xts::first() masks data.table::first()</span></span>
<span><span class="co"># x xts::last()  masks data.table::last()</span></span>
<span></span>
<span><span class="co"># See that these are now part of the fastverse</span></span>
<span><span class="fu"><a href="../reference/fastverse_packages.html">fastverse_packages</a></span><span class="op">(</span><span class="op">)</span></span>
<span><span class="co"># [1] "data.table" "magrittr"   "kit"        "collapse"   "xts"       </span></span>
<span><span class="co"># [6] "roll"       "fasttime"   "fastverse"</span></span>
<span></span>
<span><span class="co"># They are also saved in a like-named option </span></span>
<span><span class="fu"><a href="https://rdrr.io/r/base/options.html" class="external-link">options</a></span><span class="op">(</span><span class="st">"fastverse.extend"</span><span class="op">)</span></span>
<span><span class="co"># $fastverse.extend</span></span>
<span><span class="co"># [1] "xts"      "roll"     "fasttime"</span></span></code></pre></div>
<p>All <em>fastverse</em> packages (or particular packages) can be
detached using <code>fastverse_detach</code>.</p>
<div class="sourceCode" id="cb4"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="co"># Detaches all packages (including the fastverse) but does not (default) unload them</span></span>
<span><span class="fu"><a href="../reference/fastverse_detach.html">fastverse_detach</a></span><span class="op">(</span><span class="op">)</span></span></code></pre></div>
<p>For programming purposes it is also possible to pass vectors of
packages to both <code>fastverse_extend</code> and
<code>fastverse_detach</code><a class="footnote-ref" tabindex="0" data-bs-toggle="popover" data-bs-content="&lt;p&gt;In particular, the &lt;code&gt;...&lt;/code&gt; expression is first
captured using &lt;code&gt;substitute(c(...))&lt;/code&gt;, and then evaluated
inside &lt;code&gt;tryCatch&lt;/code&gt;. If this evaluation fails or did not result
in a character vector, the expression is coerced to character.&lt;/p&gt;"><sup>3</sup></a>. The defaults of
<code>fastverse_detach</code> are set such that detaching is very
‘light’. Packages are not unloaded and all <em>fastverse</em> options
set for the session are kept.</p>
<div class="sourceCode" id="cb5"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="co"># Extensions are still here ...</span></span>
<span><span class="fu"><a href="https://rdrr.io/r/base/options.html" class="external-link">options</a></span><span class="op">(</span><span class="st">"fastverse.extend"</span><span class="op">)</span></span>
<span><span class="co"># $fastverse.extend</span></span>
<span><span class="co"># [1] "xts"      "roll"     "fasttime"</span></span>
<span></span>
<span><span class="co"># Thus attaching the fastverse again will include them</span></span>
<span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">library</a></span><span class="op">(</span><span class="va"><a href="https://fastverse.github.io/fastverse/" class="external-link">fastverse</a></span><span class="op">)</span></span>
<span><span class="co"># -- Attaching packages --------------------------------------- fastverse 0.3.2 --</span></span>
<span><span class="co"># v data.table 1.14.8         v xts        0.13.1    </span></span>
<span><span class="co"># v magrittr   2.0.3          v roll       1.1.6     </span></span>
<span><span class="co"># v kit        0.0.13         v fasttime   1.1.0     </span></span>
<span><span class="co"># v collapse   1.9.6.9500</span></span>
<span><span class="co"># -- Conflicts ------------------------------------------ fastverse_conflicts() --</span></span>
<span><span class="co"># x xts::first() masks data.table::first()</span></span>
<span><span class="co"># x xts::last()  masks data.table::last()</span></span></code></pre></div>
<p>‘Harder’ modes of detaching can be achieved using arguments
<code>unload = TRUE</code> (and <code>force = TRUE</code>) to
(forcefully) detach and unload <em>fastverse</em> packages, and/or
<code>session = TRUE</code> which will clear all <em>fastverse</em>
options set<a class="footnote-ref" tabindex="0" data-bs-toggle="popover" data-bs-content='&lt;p&gt;&lt;code&gt;options("fastverse.quiet")&lt;/code&gt; and
&lt;code&gt;options("fastverse.styling")&lt;/code&gt; will only be cleared if all
packages are detached. If selected packages are detached, they are
removed from &lt;code&gt;options("fastverse.extend")&lt;/code&gt;.&lt;/p&gt;'><sup>4</sup></a>.</p>
<div class="sourceCode" id="cb6"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="co"># Detaching and unloading all packages and clearing options</span></span>
<span><span class="fu"><a href="../reference/fastverse_detach.html">fastverse_detach</a></span><span class="op">(</span>session <span class="op">=</span> <span class="cn">TRUE</span>, unload <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span>
<span><span class="co"># Warning: 'magrittr' namespace cannot be unloaded:</span></span>
<span><span class="co">#   namespace 'magrittr' is imported by 'purrr', 'pkgdown', 'stringr' so cannot be unloaded</span></span></code></pre></div>
<p><code>fastverse_detach</code> can also be used to detach any other
attached packages not part of the <em>fastverse</em>. It is recommended
to load all packages used in the current session through
<code><a href="../reference/fastverse_extend.html">fastverse_extend()</a></code>, to display any conflicts when they are
loaded and be able to keep track of the search path with
<code><a href="../reference/fastverse_conflicts.html">fastverse_conflicts()</a></code>.</p>
<p>Since <code>options("fastverse.extend")</code> keeps track of which
packages were added to the <em>fastverse</em> for the current session,
it is also possible to set it before loading the <em>fastverse</em>
e.g. </p>
<div class="sourceCode" id="cb7"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="fu"><a href="https://rdrr.io/r/base/options.html" class="external-link">options</a></span><span class="op">(</span>fastverse.extend <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"qs"</span>, <span class="st">"fst"</span><span class="op">)</span><span class="op">)</span></span>
<span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">library</a></span><span class="op">(</span><span class="va"><a href="https://fastverse.github.io/fastverse/" class="external-link">fastverse</a></span><span class="op">)</span></span>
<span><span class="co"># -- Attaching packages --------------------------------------- fastverse 0.3.2 --</span></span>
<span><span class="co"># v data.table 1.14.8         v collapse   1.9.6.9500</span></span>
<span><span class="co"># v magrittr   2.0.3          v qs         0.25.5    </span></span>
<span><span class="co"># v kit        0.0.13         v fst        0.9.8</span></span>
<span></span>
<span><span class="fu"><a href="../reference/fastverse_detach.html">fastverse_detach</a></span><span class="op">(</span>session <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span></code></pre></div>
</div>
<div class="section level2">
<h2 id="permanent-extensions">Permanent Extensions<a class="anchor" aria-label="anchor" href="#permanent-extensions"></a>
</h2>
<p><code>fasvtverse_extend</code> and <code>fastverse_detach</code> both
have an argument <code>permanent = TRUE</code> which can be used to make
these changes persist across R sessions. This is implemented using a
global configuration file saved to the package directory<a class="footnote-ref" tabindex="0" data-bs-toggle="popover" data-bs-content="&lt;p&gt;Thus it will be removed when the &lt;em&gt;fastverse&lt;/em&gt; is
reinstalled.&lt;/p&gt;"><sup>5</sup></a>.</p>
<p>For example, suppose most of my work involves time series analysis,
and I would like to add <em>xts</em>, <em>zoo</em>, <em>anytime</em> and
<em>roll</em> to my <em>fastverse</em>. Let’s say I also don’t really
need the switches and parallel statistics provided by the <em>kit</em>
package and I am completely happy with the base pipe so I don’t need
<em>magrittr</em>. Let’s finally say that I don’t want
<code><a href="https://rdrr.io/pkg/xts/man/first.html" class="external-link">xts::first</a></code> and <code><a href="https://rdrr.io/pkg/xts/man/first.html" class="external-link">xts::last</a></code> to mask
<code><a href="https://Rdatatable.gitlab.io/data.table/reference/last.html" class="external-link">data.table::first</a></code> and <code><a href="https://Rdatatable.gitlab.io/data.table/reference/last.html" class="external-link">data.table::last</a></code>.</p>
<p>Then I could permanently modify my <em>fastverse</em> as follows<a class="footnote-ref" tabindex="0" data-bs-toggle="popover" data-bs-content='&lt;p&gt;I note that namespace conflicts can also be detected and
handled with the &lt;a href="https://cran.r-project.org/package=conflicted" class="external-link"&gt;conflicted&lt;/a&gt;
package on CRAN.&lt;/p&gt;'><sup>6</sup></a>:</p>
<div class="sourceCode" id="cb8"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">library</a></span><span class="op">(</span><span class="va"><a href="https://fastverse.github.io/fastverse/" class="external-link">fastverse</a></span><span class="op">)</span></span>
<span><span class="co"># -- Attaching packages --------------------------------------- fastverse 0.3.2 --</span></span>
<span><span class="co"># v data.table 1.14.8         v kit        0.0.13    </span></span>
<span><span class="co"># v magrittr   2.0.3          v collapse   1.9.6.9500</span></span>
<span></span>
<span><span class="co"># Adding extensions</span></span>
<span><span class="fu"><a href="../reference/fastverse_extend.html">fastverse_extend</a></span><span class="op">(</span><span class="va">xts</span>, <span class="va">zoo</span>, <span class="va">roll</span>, <span class="va">anytime</span>, permanent <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span>
<span><span class="co"># -- Attaching extension packages ----------------------------- fastverse 0.3.2 --</span></span>
<span><span class="co"># v xts     0.13.1     v anytime 0.3.9 </span></span>
<span><span class="co"># v roll    1.1.6</span></span>
<span><span class="co"># -- Conflicts ------------------------------------------ fastverse_conflicts() --</span></span>
<span><span class="co"># x zoo::as.Date()         masks base::as.Date()</span></span>
<span><span class="co"># x zoo::as.Date.numeric() masks base::as.Date.numeric()</span></span>
<span><span class="co"># x xts::first()           masks data.table::first()</span></span>
<span><span class="co"># x xts::last()            masks data.table::last()</span></span>
<span></span>
<span><span class="co"># Removing some core packages</span></span>
<span><span class="fu"><a href="../reference/fastverse_detach.html">fastverse_detach</a></span><span class="op">(</span><span class="va">data.table</span>, <span class="va">kit</span>, <span class="va">magrittr</span>, permanent <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span>
<span></span>
<span><span class="co"># Adding data.table again, so it is attached last</span></span>
<span><span class="fu"><a href="../reference/fastverse_extend.html">fastverse_extend</a></span><span class="op">(</span><span class="va">data.table</span>, permanent <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span>
<span><span class="co"># -- Attaching extension packages ----------------------------- fastverse 0.3.2 --</span></span>
<span><span class="co"># v data.table 1.14.8</span></span>
<span><span class="co"># -- Conflicts ------------------------------------------ fastverse_conflicts() --</span></span>
<span><span class="co"># x data.table::first() masks xts::first()</span></span>
<span><span class="co"># x data.table::last()  masks xts::last()</span></span></code></pre></div>
<p>To verify our modification, we can see the order in which the
packages are attached, and do a conflict check:</p>
<div class="sourceCode" id="cb9"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="co"># This will be the order in which packages are attached</span></span>
<span><span class="fu"><a href="../reference/fastverse_packages.html">fastverse_packages</a></span><span class="op">(</span>include.self <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span></span>
<span><span class="co"># [1] "collapse"   "xts"        "zoo"        "roll"       "anytime"   </span></span>
<span><span class="co"># [6] "data.table"</span></span>
<span></span>
<span><span class="co"># Check conflicts to make sure data.table functions take precedence</span></span>
<span><span class="fu"><a href="../reference/fastverse_conflicts.html">fastverse_conflicts</a></span><span class="op">(</span><span class="op">)</span></span>
<span><span class="co"># -- Conflicts ------------------------------------------ fastverse_conflicts() --</span></span>
<span><span class="co"># x zoo::as.Date()         masks base::as.Date()</span></span>
<span><span class="co"># x zoo::as.Date.numeric() masks base::as.Date.numeric()</span></span>
<span><span class="co"># x data.table::first()    masks xts::first()</span></span>
<span><span class="co"># x data.table::last()     masks xts::last()</span></span></code></pre></div>
<p>Note that <code>options("fastverse.extend")</code> is still empty,
because we have written those changes to a config file<a class="footnote-ref" tabindex="0" data-bs-toggle="popover" data-bs-content='&lt;p&gt;When fetching the names of &lt;em&gt;fastverse&lt;/em&gt; packages,
&lt;code&gt;fastverse_packages&lt;/code&gt; first checks any config file and then
checks &lt;code&gt;options("fastverse.extend")&lt;/code&gt;.&lt;/p&gt;'><sup>7</sup></a>. Now lets see if our
permanent modification worked:</p>
<div class="sourceCode" id="cb10"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="co"># Detach all packages and clear all options</span></span>
<span><span class="fu"><a href="../reference/fastverse_detach.html">fastverse_detach</a></span><span class="op">(</span>session <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span></code></pre></div>
<div class="sourceCode" id="cb11"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">library</a></span><span class="op">(</span><span class="va"><a href="https://fastverse.github.io/fastverse/" class="external-link">fastverse</a></span><span class="op">)</span> </span>
<span><span class="co"># -- Attaching packages --------------------------------------- fastverse 0.3.2 --</span></span>
<span><span class="co"># v collapse   1.9.6.9500     v roll       1.1.6     </span></span>
<span><span class="co"># v xts        0.13.1         v anytime    0.3.9     </span></span>
<span><span class="co"># v zoo        1.8.12         v data.table 1.14.8</span></span>
<span><span class="co"># -- Conflicts ------------------------------------------ fastverse_conflicts() --</span></span>
<span><span class="co"># x zoo::as.Date()         masks base::as.Date()</span></span>
<span><span class="co"># x zoo::as.Date.numeric() masks base::as.Date.numeric()</span></span>
<span><span class="co"># x data.table::first()    masks xts::first()</span></span>
<span><span class="co"># x data.table::last()     masks xts::last()</span></span></code></pre></div>
<p>After this permanent modification, the <em>fastverse</em> can still
be extend for the session:</p>
<div class="sourceCode" id="cb12"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="co"># Extension for the session</span></span>
<span><span class="fu"><a href="../reference/fastverse_extend.html">fastverse_extend</a></span><span class="op">(</span><span class="va">Rfast</span>, <span class="va">coop</span><span class="op">)</span></span>
<span><span class="co"># -- Attaching extension packages ----------------------------- fastverse 0.3.2 --</span></span>
<span><span class="co"># v Rfast 2.0.8     v coop  0.6.3</span></span>
<span><span class="co"># -- Conflicts ------------------------------------------ fastverse_conflicts() --</span></span>
<span><span class="co"># x Rfast::group()     masks collapse::group()</span></span>
<span><span class="co"># x Rfast::transpose() masks data.table::transpose()</span></span>
<span></span>
<span><span class="co"># These packages go here</span></span>
<span><span class="fu"><a href="https://rdrr.io/r/base/options.html" class="external-link">options</a></span><span class="op">(</span><span class="st">"fastverse.extend"</span><span class="op">)</span></span>
<span><span class="co"># $fastverse.extend</span></span>
<span><span class="co"># [1] "Rfast" "coop"</span></span>
<span></span>
<span><span class="co"># This fetches packages from both the file and the option</span></span>
<span><span class="fu"><a href="../reference/fastverse_packages.html">fastverse_packages</a></span><span class="op">(</span><span class="op">)</span></span>
<span><span class="co"># [1] "collapse"   "xts"        "zoo"        "roll"       "anytime"   </span></span>
<span><span class="co"># [6] "data.table" "Rfast"      "coop"       "fastverse"</span></span></code></pre></div>
<p>As long as the current installation of the <em>fastverse</em> is
kept, these modifications will persist across R sessions. Needless to
say this is not ideal as reinstallation of the <em>fastverse</em> will
remove the config file. Therefore, the <em>fastverse</em> also offers a
persistent and more flexible mechanism to configure it inside
projects.</p>
</div>
<div class="section level2">
<h2 id="custom-fastverse-configurations-for-projects">Custom <em>fastverse</em> Configurations for Projects<a class="anchor" aria-label="anchor" href="#custom-fastverse-configurations-for-projects"></a>
</h2>
<p>You can put together a custom collection of packages for a project,
and load / manage them with <code><a href="https://fastverse.github.io/fastverse/" class="external-link">library(fastverse)</a></code>.</p>
<p>For this you need to include a configuration file named
<code>.fastverse</code> (no file extension) inside a project directory,
and place inside that file the names of packages to be loaded when
calling <code><a href="https://fastverse.github.io/fastverse/" class="external-link">library(fastverse)</a></code><a class="footnote-ref" tabindex="0" data-bs-toggle="popover" data-bs-content="&lt;p&gt;You can place package names in that file any manner you
deem suitable: separated using spaces or commas, on one or multiple
lines. Note that the file will be read from left to right and from top
to bottom. Packages are attached in the order found in the file.&lt;/p&gt;"><sup>8</sup></a>. Note that
<strong>all</strong> packages to be loaded as core <em>fastverse</em>
for your project need to be included in that file, in the order they
should be attached.</p>
<p>In addition, you can set global options and environment variables,
either before or after the list of packages. Options must be prefixed
with <code>_opt_</code> and environment variables with
<code>_env_</code>, and either must be placed on separate lines. For
example, including a <code>.fastverse</code> script like this</p>
<pre><code>_opt_collapse_mask = c("manip", "helper")
_opt_fastverse.install = TRUE

data.table, kit, magrittr, collapse, qs, fixest, 
ranger, robustbase, decompr

_opt_max.print = 100
_opt_kit.nThread = 4
_env_NCRAN = TRUE</code></pre>
<p>in a project directory, and placing <code><a href="https://fastverse.github.io/fastverse/" class="external-link">library(fastverse)</a></code>
at the top of an R script in the project will first set
<code>options(collapse_mask = c("manip", "helper), fastverse.install = TRUE)</code><a class="footnote-ref" tabindex="0" data-bs-toggle="popover" data-bs-content='&lt;p&gt;Setting &lt;code&gt;options(fastverse.install = TRUE)&lt;/code&gt;
before loading the packages will make sure any packages missing on your
system will be installed beforehand.
&lt;code&gt;options(collapse_mask = ...)&lt;/code&gt; can be used to make base R and
dplyr functions with faster versions provided in the &lt;em&gt;collapse&lt;/em&gt;
package. See &lt;code&gt;help("collapse-options")&lt;/code&gt;.&lt;/p&gt;'><sup>9</sup></a>, then
attach all the packages in the order provided, and then set
<code>options(max.print = 100, kit.nThread = 4)</code> and
<code>Sys.setenv(NCRAN = TRUE)</code>. Note that packages can be spread
across multiple lines, but need to be together i.e. they cannot be
separated by options. Alternatively you can also use an
<code>.Rprofile</code> file and set <em>fastverse</em> options such as
<code>options(fastverse.extend = c(...packages...))</code> there. The
advantage of <code>.fastverse</code> files is that you can specify
options to be loaded before or after the loading of packages through
<code><a href="https://fastverse.github.io/fastverse/" class="external-link">library(fastverse)</a></code><a class="footnote-ref" tabindex="0" data-bs-toggle="popover" data-bs-content="&lt;p&gt;This may be useful if packages set certain options when
being loaded, overwriting any prior settings, or if options affect the
way packages are loaded and should better be set after they are
loaded.&lt;/p&gt;"><sup>10</sup></a>, and you can also prevent core packages
from being loaded by excluding them from the <code>.fastverse</code>
file.</p>
<p>Using the <em>fastverse</em> to jointly load important packages and
set important options can facilitate package management inside projects
and serve as a bridge between loading packages individually and using
more rigorous package and namespace management solutions such as <a href="https://github.com/rstudio/renv" class="external-link">renv</a>, <a href="https://github.com/r-lib/conflicted" class="external-link">conflicted</a>, <a href="https://github.com/klmr/box" class="external-link">box</a> or <a href="https://github.com/rticulate/import" class="external-link">import</a>.</p>
<p>At the most basic level, loading packages with the <em>fastverse</em>
displays the package versions and checks namespace conflicts, helping
you spot issues that might arise as packages are updated. It also allows
you to easily check the dependencies and update status of packages used
in your project with <code><a href="../reference/fastverse_sitrep.html">fastverse_sitrep()</a></code>, and update if
necessary with <code><a href="../reference/fastverse_update.html">fastverse_update()</a></code>.</p>
<!-- 
You additionally have the option to call `fastverse::fastverse_install()` at the beginning of a project file before calling `library(fastverse)`. This will execute a swift check if all packages listed in `.fastverse` are available, and, by default, install any missing packages needed for the project. -->
<p>Using a config file in a project will ignore any global configuration
as discussed in the previous section. You can still extend the
<em>fastverse</em> inside a project session using
<code>fastverse_extend</code> (or
<code>options(fastvers.extend = c(...packages...))</code> before
<code><a href="https://fastverse.github.io/fastverse/" class="external-link">library(fastverse)</a></code>).</p>
</div>
<div class="section level2">
<h2 id="creating-separate-package-verses">Creating Separate Package-Verses<a class="anchor" aria-label="anchor" href="#creating-separate-package-verses"></a>
</h2>
<p>At last, you can also create wholly separate and fully customizable
verses - with the <code><a href="../reference/fastverse_child.html">fastverse_child()</a></code> function. Let’s say I
would like to create a verse for time series analysis that I want to
keep separate from the <em>fastverse</em>. This is easily done using
e.g.</p>
<div class="sourceCode" id="cb14"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="fu"><a href="../reference/fastverse_child.html">fastverse_child</a></span><span class="op">(</span></span>
<span>  name <span class="op">=</span> <span class="st">"tsverse"</span>, </span>
<span>  title <span class="op">=</span> <span class="st">"Time Series Package Verse"</span>, </span>
<span>  pkg <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"xts"</span>, <span class="st">"roll"</span>, <span class="st">"zoo"</span>, <span class="st">"tsbox"</span>, <span class="st">"urca"</span>, <span class="st">"tseries"</span>, <span class="st">"tsutils"</span>, <span class="st">"forecast"</span><span class="op">)</span>, </span>
<span>  maintainer <span class="op">=</span> <span class="st">'person("GivenName", "FamilyName", role = "cre", email = "your@email.com")'</span>,</span>
<span>  dir <span class="op">=</span> <span class="st">"C:/Users/.../Documents"</span>, </span>
<span>  theme <span class="op">=</span> <span class="st">"tidyverse"</span><span class="op">)</span></span></code></pre></div>
<p>By default (<code>install = TRUE</code>,
<code>keep.dir = TRUE</code>) the package is installed and a source
directory is created under dir/name, allowing further edits to the
package. Such <em>fastverse</em> children inherit 90% of the
functionality of the <em>fastverse</em> package: they are not
permanently globally extensible and can not bear children themselves,
but can be configured for projects (using, in this case, a
<code>.tsverse</code> config file and options starting with ‘tsverse’)
and extended in the session. The function uses a prepared ‘child’ branch
of the <a href="https://github.com/fastverse/fastverse" class="external-link">GitHub
repository</a>, and thus does not require any further packages such as
<code>devtools</code>.</p>
</div>
<div class="section level2">
<h2 id="dependencies-situational-reports-and-updating">Dependencies, Situational Reports and Updating<a class="anchor" aria-label="anchor" href="#dependencies-situational-reports-and-updating"></a>
</h2>
<p>Just like it’s <em>tidyverse</em> equivalent,
<code><a href="../reference/fastverse_deps.html">fastverse_deps()</a></code> (recursively) determines the joint
dependencies of <em>fastverse</em> packages and also checks local
versions against CRAN versions.</p>
<div class="sourceCode" id="cb15"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="co"># Recursively determine the joint dependencies of the current fastverse configuration</span></span>
<span><span class="fu"><a href="../reference/fastverse_deps.html">fastverse_deps</a></span><span class="op">(</span>recursive <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span> <span class="co"># Returns a data frame</span></span>
<span><span class="co">#          package      repos      local behind</span></span>
<span><span class="co"># 1       collapse      1.9.6 1.9.6.9500  FALSE</span></span>
<span><span class="co"># 2            xts     0.13.1     0.13.1  FALSE</span></span>
<span><span class="co"># 3            zoo     1.8.12     1.8.12  FALSE</span></span>
<span><span class="co"># 4           roll      1.1.6      1.1.6  FALSE</span></span>
<span><span class="co"># 5        anytime      0.3.9      0.3.9  FALSE</span></span>
<span><span class="co"># 6     data.table     1.14.8     1.14.8  FALSE</span></span>
<span><span class="co"># 7          Rfast      2.0.8      2.0.8  FALSE</span></span>
<span><span class="co"># 8           coop      0.6.3      0.6.3  FALSE</span></span>
<span><span class="co"># 9             BH   1.81.0.1   1.81.0.1  FALSE</span></span>
<span><span class="co"># 10       lattice     0.21.8     0.21.8  FALSE</span></span>
<span><span class="co"># 11          Rcpp     1.0.11     1.0.11  FALSE</span></span>
<span><span class="co"># 12 RcppArmadillo 0.12.6.4.0 0.12.2.0.0   TRUE</span></span>
<span><span class="co"># 13       RcppGSL     0.3.13     0.3.13  FALSE</span></span>
<span><span class="co"># 14  RcppParallel      5.1.7      5.1.7  FALSE</span></span>
<span><span class="co"># 15  RcppZiggurat      0.1.6      0.1.6  FALSE</span></span></code></pre></div>
<p>Additional flexibility is offered by the <code>pkg</code> argument
allowing dependency and update status checks for any other packages.
<code><a href="../reference/fastverse_sitrep.html">fastverse_sitrep()</a></code> displays the same information in a more
elegant printout, also showing the version of R, and whether any global
or project-level configuration files - as discussed in previous sections
- are used.</p>
<div class="sourceCode" id="cb16"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="co"># Check versions and update status of packages and dependencies</span></span>
<span><span class="fu"><a href="../reference/fastverse_sitrep.html">fastverse_sitrep</a></span><span class="op">(</span><span class="op">)</span> <span class="co"># default is recursive = FALSE</span></span>
<span><span class="co"># -- fastverse 0.3.2: Situation Report -------------------------------- R 4.3.0 --</span></span>
<span><span class="co">#  * Global config file: TRUE</span></span>
<span><span class="co">#  * Project config file: FALSE</span></span>
<span><span class="co"># -- Core packages --------------------------------------------------------------- </span></span>
<span><span class="co">#  * collapse      (1.9.6.9500)</span></span>
<span><span class="co">#  * xts           (0.13.1)</span></span>
<span><span class="co">#  * zoo           (1.8.12)</span></span>
<span><span class="co">#  * roll          (1.1.6)</span></span>
<span><span class="co">#  * anytime       (0.3.9)</span></span>
<span><span class="co">#  * data.table    (1.14.8)</span></span>
<span><span class="co"># -- Extension packages ---------------------------------------------------------- </span></span>
<span><span class="co">#  * Rfast         (2.0.8)</span></span>
<span><span class="co">#  * coop          (0.6.3)</span></span>
<span><span class="co"># -- Dependencies ---------------------------------------------------------------- </span></span>
<span><span class="co">#  * BH            (1.81.0.1)</span></span>
<span><span class="co">#  * lattice       (0.21.8)</span></span>
<span><span class="co">#  * Rcpp          (1.0.11)</span></span>
<span><span class="co">#  * RcppArmadillo (0.12.2.0.0 &lt; 0.12.6.4.0)</span></span>
<span><span class="co">#  * RcppParallel  (5.1.7)</span></span>
<span><span class="co">#  * RcppZiggurat  (0.1.6)</span></span></code></pre></div>
<p><code><a href="../reference/fastverse_update.html">fastverse_update()</a></code> can be used to (default) print an
<code><a href="https://rdrr.io/r/utils/install.packages.html" class="external-link">install.packages()</a></code> statement to update <em>fastverse</em>
packages and dependencies, or to install updates straight away
(<code>install = TRUE</code>). In all three functions,
<code>check.deps = FALSE</code> can be specified to exclude dependencies
of <em>fastverse</em> packages, <code>recursive = TRUE</code> can be
used to check all dependencies, and <code>include.self = TRUE</code> can
be used to also check for updates of the <code>fastverse</code> package
itself.</p>
<p>The development versions of all core and suggested <em>fastverse</em>
packages are also collected on an <a href="https://fastverse.r-universe.dev" class="external-link">r-universe server</a> at <a href="https://fastverse.r-universe.dev" class="external-link uri">https://fastverse.r-universe.dev</a>. Mac/Windows binaries
are built on this server within 24h after a change to the main branch of
the GitHub repository. Since v0.3.0 the package exports a global macro
<code>.fastverse_repos</code> which contains the URL of this repository
alongside the CRAN repository URL (needed for non-<em>fastverse</em>
dependencies). Functions <code><a href="../reference/fastverse_deps.html">fastverse_deps()</a></code>,
<code><a href="../reference/fastverse_update.html">fastverse_update()</a></code>, <code><a href="../reference/fastverse_install.html">fastverse_install()</a></code> and
<code>fastverse_siteep()</code> have a <code>repos</code> argument which
defaults to <code>getOption("repos")</code> (CRAN), but users can set
<code>repos = .fastverse_repos</code> to check against / update /
install development versions of <em>fastverse</em> packages from
r-universe.</p>
<div class="sourceCode" id="cb17"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="co"># Check development versions on GitHub / r-universe, and install them if desired. </span></span>
<span><span class="fu"><a href="../reference/fastverse_update.html">fastverse_update</a></span><span class="op">(</span>repos <span class="op">=</span> <span class="va">.fastverse_repos</span><span class="op">)</span> </span>
<span><span class="co"># The following packages are out of date:</span></span>
<span><span class="co"># </span></span>
<span><span class="co">#  * xts           (0.13.1 -&gt; 0.13.1.2)</span></span>
<span><span class="co">#  * roll          (1.1.6 -&gt; 1.1.7)</span></span>
<span><span class="co">#  * anytime       (0.3.9 -&gt; 0.3.9.5)</span></span>
<span><span class="co">#  * data.table    (1.14.8 -&gt; 1.14.9)</span></span>
<span><span class="co">#  * Rcpp          (1.0.11 -&gt; 1.0.11.2)</span></span>
<span><span class="co">#  * RcppArmadillo (0.12.2.0.0 -&gt; 0.12.6.4.0)</span></span>
<span><span class="co"># </span></span>
<span><span class="co"># Start a clean R session then run:</span></span>
<span><span class="co"># install.packages(c("xts", "roll", "anytime", "data.table", "Rcpp", "RcppArmadillo"</span></span>
<span><span class="co"># ), repos = c(fastverse = "https://fastverse.r-universe.dev", CRAN = "https://cloud.r-project.org"))</span></span></code></pre></div>
</div>
<div class="section level2">
<h2 id="other-fastverse-options">Other <em>fastverse</em> Options<a class="anchor" aria-label="anchor" href="#other-fastverse-options"></a>
</h2>
<p>Apart from <code>"fastverse.extend"</code>, the <em>fastverse</em>
also has options <code>"fastverse.install"</code>,
<code>"fastverse.styling"</code> and <code>"fastverse.quiet"</code>.
Setting <code>options(fastverse.install = TRUE)</code> before
<code><a href="https://fastverse.github.io/fastverse/" class="external-link">library(fastverse)</a></code> will make sure any packages missing on
your system will be installed beforehand. This can also be done ex-post
using the <code><a href="../reference/fastverse_install.html">fastverse_install()</a></code> function. Setting
<code>options(fastverse.styling = FALSE)</code> will disable coloured
text printed to the R console (as done for this vignette).
<code>options(fastverse.quiet = TRUE)</code> will omit any messages
printed from <code><a href="https://fastverse.github.io/fastverse/" class="external-link">library(fastverse)</a></code> and
<code><a href="../reference/fastverse_extend.html">fastverse_extend()</a></code> or <code><a href="../reference/fastverse_install.html">fastverse_install()</a></code>:</p>
<div class="sourceCode" id="cb18"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="fu"><a href="../reference/fastverse_detach.html">fastverse_detach</a></span><span class="op">(</span><span class="op">)</span></span>
<span><span class="fu"><a href="https://rdrr.io/r/base/options.html" class="external-link">options</a></span><span class="op">(</span>fastverse.quiet <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span>
<span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">library</a></span><span class="op">(</span><span class="va"><a href="https://fastverse.github.io/fastverse/" class="external-link">fastverse</a></span><span class="op">)</span> <span class="co"># Nothing to see here</span></span>
<span></span>
<span><span class="co"># This gives lots of function clashes with data.table, but they are not displayed in quiet mode</span></span>
<span><span class="fu"><a href="../reference/fastverse_extend.html">fastverse_extend</a></span><span class="op">(</span><span class="va">lubridate</span><span class="op">)</span></span></code></pre></div>
<p>If you only want to omit a function clash check when calling
<code>fastverse_extend</code>, you can also use
<code>fastverse_extend(..., check.conflicts = FALSE)</code>.</p>
</div>
<div class="section level2">
<h2 id="conclusion">Conclusion<a class="anchor" aria-label="anchor" href="#conclusion"></a>
</h2>
<p>The <em>fastverse</em> was developed principally for 2 reasons: to
promote quality high-performance software development for R, and to
provide a flexible approach to package loading and management in R,
particularly for users wishing to combine various high-performance
packages in statistical workflows. To the extent that high-performance
software development in R continues to prioritize low-dependency and
stable APIs, complex statistical and project workflows can be developed
without sophisticated package management solutions.</p>
<!-- This vignette introduced the key features of the package. Suggested *fastverse* extension packages are introduced in the [README](<https://fastverse.github.io/fastverse/#suggested-extensions>) file. -->
<div class="sourceCode" id="cb19"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="co"># Resetting the fastverse to defaults (clearing all permanent extensions and options)</span></span>
<span><span class="fu"><a href="../reference/fastverse_reset.html">fastverse_reset</a></span><span class="op">(</span><span class="op">)</span></span>
<span><span class="co"># Detaching </span></span>
<span><span class="fu"><a href="../reference/fastverse_detach.html">fastverse_detach</a></span><span class="op">(</span><span class="op">)</span></span></code></pre></div>
</div>
<div class="section level2">
<h2 id="appendix-a-note-on-openmp-multithreading">Appendix: A note on OpenMP Multithreading<a class="anchor" aria-label="anchor" href="#appendix-a-note-on-openmp-multithreading"></a>
</h2>
<p><em>data.table</em>, <em>collapse</em> and <em>kit</em> support
OpenMP multithreading on all platforms. Global defaults can be set using
<code><a href="https://Rdatatable.gitlab.io/data.table/reference/openmp-utils.html" class="external-link">data.table::setDTthreads()</a></code>,
<code>collapse::set_collapse(nthreads = ...)</code> and
<code>options(kit.nThread = ...)</code>. Users should be careful with
running multithreaded <em>collapse</em> and <em>kit</em> functions
inside <em>data.table</em>. I have created a small <a href="https://www.youtube.com/watch?v=ne4Es2_9r5A" class="external-link">video tutorial</a>
for <em>collapse</em> where I talk more about this amongst other
things.</p>
<p>Note also that on macOS, OpenMP is disabled in binaries installed
from CRAN. To enable OpenMP on macOS, users first need to install OpenMP
and do some configuration. See <a href="https://mac.r-project.org/openmp/" class="external-link">here</a> for instructions and
the latest OpenMP releases. I have also compactly written the terminal
commands you need to run in the description of the <a href="https://www.youtube.com/watch?v=ne4Es2_9r5A" class="external-link">tutorial</a>. After
installing OpenMP and configuring your R-session, install the packages
from source or use r-universe binaries. An easy way would be to run
<code>fastverse_install(data.table, collapse, kit, only.missing = FALSE, repos = .fastverse_repos)</code>.</p>
</div>

  </main><aside class="col-md-3"><nav id="toc"><h2>On this page</h2>
    </nav></aside>
</div>



    <footer><div class="pkgdown-footer-left">
  <p></p>
<p>Developed by Sebastian Krantz.</p>
</div>

<div class="pkgdown-footer-right">
  <p></p>
<p>Site built with <a href="https://pkgdown.r-lib.org/" class="external-link">pkgdown</a> 2.0.7.</p>
</div>

    </footer>
</div>

  

  

  </body>
</html>
