list2fullDF.presence: list2fullDF.presence

View source: R/CodeAndRoll2.R

list2fullDF.presenceR Documentation

list2fullDF.presence

Description

Converts a list to a full matrix, with rows and columns named by the elements of the list. The matrix will contain a 1 in each cell where the corresponding element of the list is present, and a 0 otherwise.

Usage

list2fullDF.presence(
  your.list = list(set.1 = LETTERS[1:5], set.2 = LETTERS[3:9]),
  byRow = TRUE,
  FILL = 0
)

Arguments

your.list

A list.

byRow

Logical. Whether the resulting matrix should be arranged by row (default) or by column.

FILL

A value to fill in missing entries.

Value

A matrix with the same elements as your.list, but with rows and columns named by the elements of the list.

Examples

your.list <- list("set.1" = LETTERS[1:5], "set.2" = LETTERS[3:9])
list2fullDF.presence(your.list)


vertesy/CodeAndRoll2 documentation built on Nov. 20, 2024, 5:23 a.m.