to_tidy | R Documentation |
Convert a matrix, data.frame or tibble into a tidy tibble.
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,
...
)
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). |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.