im_read_csv: Read csv File to Incidence Matrix

View source: R/incidence.R

im_read_csvR Documentation

Read csv File to Incidence Matrix

Description

Wrapper around the read_csv function from the readr package \insertCitewickham_readr_2024lakhesis. Read a .csv file in which the first column represents row elements and the second column represents column elements, and convert it into an incidence matrix.

Usage

im_read_csv(
  filename,
  header = FALSE,
  characterencoding = "iso-8859-1",
  remove.hapax = FALSE
)

Arguments

filename

The filename to uploaded (must be in .csv format).

header

If the .csv file contains a header. Default is FALSE.

characterencoding

File encoding as used by locale, which depends on the csv file. Default is "iso-8859-1" but "utf-8" is also recommended.

remove.hapax

Remove any row or column which has a sum of 1 (i.e., is only attested once), since they do not directly contribute to the result of the seriation. Default is FALSE.

Value

A matrix of binary values (0 = row/column occurrence is absence; 1 = row/column occurrence is present).

References

\insertAllCited

lakhesis documentation built on April 25, 2026, 5:06 p.m.