If you work with R or any other programming language for a while, you
will come to the point where you want to use already written code when
developing a script and often need the same packages to do your work.The
easiest solution is to save the loading of the regularly used packages
and maybe some helper functions in a separate script and then load this
script with source(...)
into the Global Environment.
However, this approach has two disadvantages:
source
script must either be available and up-to-date on the
local machine or be made available on the Internet.The best solution for the above mentioned disadvantages is an own (personal) package, but for the setup it needs a basic understanding of how to develop packages.
The goal of personalr is to do exactly that. A basic setup of a personal package, which loads a modifiable list of packages and some basic functions.
You can install the released version of personalr from CRAN with:
install.packages("personalr")
You can install the development version from GitHub with:
if (!require("pak")) install.packages("pak")
pak::pak("mrcaseb/personalr")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.