as_cell_df: Transform data into Cell-DF Structure

View source: R/as_cell_df.R

as_cell_dfR Documentation

Transform data into Cell-DF Structure

Description

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

Usage

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

  • validate_cells which is used to validate cell_df.

  • as_cells from unpivotr package.

Examples


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()

r-rudra/tidycells documentation built on July 19, 2022, 5:10 a.m.