install.packages("broadcast", type = "source")Prerequisites & Installation
Prerequisites
First, a basic understanding of is important.
A very basic refresher for can be found in the Getting Started in R: Tinyverse Edition document.
Make sure you at least have basic knowledge of the following subjects in :
- Atomic types (logical, integer, double, complex, character, raw).
- The recursive type âlistâ.
- dimensional structures: vectors, matrices, arrays.
- common arithmetic operators (+, -, *, /, etc.), relational operators (==, !=, etc.), logical operators (&, |), and common bit-wise operations.
- vector recycling
Requirements
âbroadcastâ requires version 4.2.0 or later; you can download from https://cran.r-project.org/mirrors.html.
âbroadcastâ has only one dependency: âRcppâ version 1.0.14 or later. To install âRcppâ, run install.packages("Rcpp") in .
Those using the Windows Operating System also need âRToolsâ. You can download âRToolsâ from https://cran.r-project.org/bin/windows/Rtools/.
Installation
Basic Instructions
To install the current version of âbroadcastâ from CRAN, run the following code in :
It is possible that you may be asked if you want to install from sources that require compilation; select âYesâ; note that this requires âRToolsâ.
To install the development version of âbroadcastâ from GitHub, one may run the following code in :
remotes::install_github("https://github.com/tony-aw/broadcast")
Additional Information for Advanced Users.
The following instructions are only for advanced users.
First, âbroadcastâ will be compiled as instructed by the userâs own âMakevarsâ / âMakevars.winâ file - if it exists. It might be possible to make the methods and functions of the âbroadcastâ package faster by adding the CXXFLAGS compiler flag -O3 to your âMakevarsâ / âMakevars.winâ file, which enables more aggressive optimization during installation.
The Makevars file should be located/created in the path.expand("~/.R") directory.
Second, âbroadcastâ is not a large package per-sĂ©, but it does contain a large amount of compiled code (âCâ and âC++â code). Compilation of the package, especially with -O3, may therefore be slow on some operating systems, especially Linux systems; please be patient. On an average PC running Windows 11, installation of the âbroadcastâ package shouldnât take more than just a few minutes.
If installation is too slow, one may try to speed up the installation using multi-threading, by running the following code before installing âbroadcastâ:
nthreads <- 8L # specify number of threads
Sys.setenv(MAKEFLAGS = paste0("-j", nthreads))
Start using the package
To attach the âbroadcastâ package - thus expose its functions to the namespace - please use the following:
library(broadcast)
To open the introduction help page of the âbroadcastâ package, please use any of the following:
?broadcast::broadcast
?broadcast::broadcast_help
?broadcast::`broadcast-package`