The goal of samplr is to provide tools to understand human performance from the perspective of sampling, both looking at how people generate samples and how people use the samples they have generated. A longer overview and other resources can be found at sampling.warwick.ac.uk.
You can install samplr from CRAN:
or install the development version from Github with:
or alternatively using the remotes
package
If you are installing the development version on MacOS, you will need the following prior to installation:
xcode-select --install
in a terminal. You may also check if those are already installed by running pkgbuild::check_build_tools()
in
/usr/local/gfortran
.Read more about it on the macOS Prerequisites section in the R Installation and Administration Manual.
If you are installing the development version on Windows, you will need to have RTools installed, which you can find here. Please make sure you install the version corresponding to your R version (i.e. for R 4.3.3, you’d need RTools 4.3).
The samplr package provides tools to generate samples following particular algorithms
library(samplr)
set.seed(1)
chain <- sampler_mh(start = 1, distr_name = "norm", distr_params = c(0,1), sigma_prop = diag(1) * .5, iterations = 2048)
r <- plot_series(chain[[1]], change = FALSE)
As well as tools to diagnose the patterns both from samplers and participants:
v <- calc_all(chain[[1]][1:200])