to_tidy: to_tidy

View source: R/misc.R

to_tidyR Documentation

to_tidy

Description

Convert a matrix, data.frame or tibble into a tidy tibble.

Usage

to_tidy(x, ...)

## S3 method for class 'matrix'
to_tidy(x, row.name = "row", ...)

## S3 method for class 'data.frame'
to_tidy(x, row.name = "row", ...)

## S3 method for class 'tbl_df'
to_tidy(
  x,
  row.name = "row",
  col.name = "col",
  value.name = "value",
  stringsAsFactors = FALSE,
  ...
)

Arguments

x

a matrix, data.frame or tibble object.

...

arguments passed to methods.

row.name

name for row data.

col.name

name for column data.

value.name

name use for value column.

stringsAsFactors

logical; whether to convert col/row names to factors (preserving original ordering).


ddiez/omisc documentation built on Aug. 14, 2024, 1:19 p.m.