set.seed(0) knitr::opts_chunk$set(echo = TRUE) library("hyper2") library("magrittr") options("digits" = 5)
knitr::include_graphics(system.file("help/figures/hyper2.png", package = "hyper2"))
To cite the hyper2
package in publications, please use @hankin2017_rmd.
This minimal document reads file icons.txt
and creates R objects
icons
, icons_matrix
, and icons_maxp
. The dataset is discussed
extensively in @west2008 and @hankin2010.
icons_table <- as.matrix(read.table("icons.txt",header=TRUE)) icons_table
Thus the first row shows that a total of $5+3+4+3=15$ respondents were
shown icons NB
, L
, THC
, and WAIS
; 5 of them chose NB
as
"most concerning", 3 chose L
, 4 chose THC
and 3 chose WAIS
.
We can use function saffy()
to convert the table into a hyper2
object:
icons <- saffy(icons_table) icons icons_maxp <- maxp(icons) icons_maxp
This file exists for consistency; an extended discussion (and
statistical tests) are presented in the vignette icons
.
Following lines create icons.rda
, residing in the data/
directory of the package.
save(icons_table,icons,icons_maxp,file="icons.rda")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.