as_cell_df: Transform data into Cell-DF Structure

Description Usage Arguments Value See Also Examples

View source: R/as_cell_df.R

Description

Transform an R object (mostly matrix or data.frame) into a cell_df for further processing in other tidycells functions.

Usage

1
as_cell_df(d, take_row_names = FALSE, take_col_names = FALSE)

Arguments

d

the data (either a matrix with column name or a data.frame)

take_row_names

consider row names as separate cells (applicable only for data with no (row, col) information). Default is FALSE.

take_col_names

consider column names as separate cells (applicable only for data with no (row, col) information). Default is FALSE.

Value

An object of class cell_df.

Note: After this, you may like to do Value Attribute Classification.

See Also

Examples

1
2
3
4
5
6
7
8
9
as_cell_df(iris)

# consider column name as cell
as_cell_df(iris, take_col_names = TRUE)

# if the data is already in a similar format it will not further transform
# which is not true for ---> unpivotr::as_cells
# check ---> unpivotr::as_cells(iris) %>% unpivotr::as_cells()
unpivotr::as_cells(iris) %>% as_cell_df()

tidycells documentation built on March 26, 2020, 7:35 p.m.