tidy_triplet: Utility function to tidy a simple triplet matrix

Description Usage Arguments Value Note

View source: R/utils.R

Description

Utility function to tidy a simple triplet matrix

Usage

1
tidy_triplet(x, triplets, row_names = NULL, col_names = NULL)

Arguments

x

Object with rownames and colnames

triplets

A data frame or list of i, j, x

row_names

rownames, if not gotten from rownames(x)

col_names

colnames, if not gotten from colnames(x)

Value

returns a triplet matrix in the form of a data frame. The first column indexes rows. The second column indexes columns. The third column contains the i,j values.

Note

This function ported from tidytext, copyright 2017 David Robinson and Julia Silge. Moved the function here for stability reasons, as it is internal to tidytext


tidylda documentation built on Dec. 11, 2021, 10:02 a.m.