Converts the active metadata component (row_data or col_data) to a data.frame. This method only works when rows or columns are active, not when the matrix is active.
Usage
# S3 method for class 'tidymatrix'
as.data.frame(x, ...)Examples
mat <- matrix(rnorm(100), nrow = 10, ncol = 10)
row_data <- data.frame(id = 1:10, group = rep(c("A", "B"), each = 5))
tm <- tidymatrix(mat, row_data)
# Convert row metadata to data.frame
df <- tm |>
activate(rows) |>
compute_prcomp(center = TRUE, scale. = TRUE) |>
as.data.frame()