set.seed(1) options(htmltools.dir.version = FALSE) knitr::opts_chunk$set(echo = TRUE, comment = "#> ", fig.retina = 4)
class: inverse, center, middle
class: middle
library(coda.base) X = as.data.frame(exp(matrix(rnorm(5*6), ncol = 5))) X
class: inverse, center, middle
coordinates(X, basis = 'alr')
coordinates(X, basis = 'clr')
coordinates(X, basis = 'ilr') all.equal(coordinates(X, basis = 'ilr'), coordinates(X))
class: inverse, center, middle
library(ggplot2) theme_set(theme_minimal()) library(microbenchmark) load('bench.RData')
autoplot(alr_bench) + labs(title = 'ALR coordinates performance')
autoplot(clr_bench) + labs(title = 'CLR coordinates performance')
autoplot(ilr_bench) + labs(title = 'ILR coordinates performance')
autoplot(matrix_bench) + labs(title = 'Coordinates performance')
class: inverse, center, middle
B.alr = alr_basis(5) B.alr coordinates(X, B.alr)
B.alr = alr_basis(5, denominator = 3, numerator = c(2,1,5,4)) B.alr coordinates(X, B.alr)
ilr_basis(5, type = 'default')
ilr_basis(5, type = 'pivot')
ilr_basis(5, type = 'cdp')
class: inverse, center, middle
bp = matrix(c(+1,+1,-1,-1, 0, +1,+1,+1,+1,-1, +1,-1, 0, 0, 0, 0, 0,+1,-1, 0), ncol = 4) sbp_basis(bp)
sbp_basis(V1+V2~V3+V4, V1+V2+V3+V4~V5, V1~V2, V3~V4, data = X)
sbp_basis(b1 = b3~b4, b2 = b1~V5, b3 = V1~V2, b4 = V3~V4, data = X)
class: inverse, center, middle
H.pc = coordinates(X, basis = 'pc') attr(H.pc, 'basis') apply(H.pc, 2, var)
H.pb = coordinates(X, basis = 'pb') attr(H.pb, 'basis') apply(H.pb, 2, var)
class: inverse, center, middle
coda.base
install.packages()
# install.packages('remotes') remotes::install_github('mcomas/coda.base')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.