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`