genMatrix: Generate Frequency Distribution Matrix

View source: R/genMatrix.R

genMatrixR Documentation

Generate Frequency Distribution Matrix

Description

For a given names dataframe and placement, a frequency distribution table is returned.

Usage

genMatrix(dframe, placement)

Arguments

dframe

A dataframe with one column that has one name per row. These names must be english alphabets from A to Z and must not include any non-alphabet characters such as as hyphen or apostrophe.

placement

A string argument that takes three values namely "first", "last" and "all". Currently, only "first" and "all" are used while the option "last" is a placeholder for future versions of the package **conjurer**

Details

The purpose of this function is to generate a frequency distribution table of alphabets. There are currently 2 tables that could be generated using this function. The first table is generated using the internal function genFirstPairs. For this, the argument placement is assigned the value "first". The rows of the table returned by the function represent the first alphabet of the string and the columns represent the second alphabet. The values in the table represent the number of times the combination is observed i.e the combination of the row and column alphabets.

The second table is generated using the internal function genTriples. For this, the argument placement is assigned the value "all". The rows of the table returned by the function represent two consecutive alphabets of the string and the columns represent the third consecutive alphabet. The values in the table represent the number of times the combination is observed i.e the combination of the row and column alphabets.

Value

A table. The rows and columns of the table depend on the argument placement. A detailed explanation is as given below in the detail section.


conjurer documentation built on Jan. 22, 2023, 1:16 a.m.