data_prob2 {exams.forge}R Documentation

Probability/Frequency Matrix Generation

Description

Generates a nrow × ncol matrix with probabilities / frequencies. If data is given it will be normalized such that sum(data[is.finite(data)])==1. If no rownames or colnames are given then event names from LETTERS are used. The returned matrix will have the following attributes:

Usage

data_prob2(
  data = NULL,
  nrow = 2,
  ncol = 2,
  colnames = NULL,
  rownames = NULL,
  ...
)

prob_mx(data = NULL, nrow = 2, ncol = 2, colnames = NULL, rownames = NULL, ...)

dprob2(data = NULL, nrow = 2, ncol = 2, colnames = NULL, rownames = NULL, ...)

Arguments

data

an optional data vector. Non-atomic classed R objects are coerced by as.vector and all attributes are discarded.

nrow

numeric: desired number of rows (default: 2)

ncol

numeric: desired number of columns (default: 2)

colnames

character: names of column events

rownames

character: names of row events

...

further parameters given to ddiscrete()

Value

A matrix and some attributes.

Examples

x <- data_prob2()
str(x)
data_prob2(colnames="E")
data_prob2(nrow=3)

[Package exams.forge version 1.0.10 Index]