Learn R Programming

Momocs (version 1.4.1)

as_df: Turn Momocs objects into tydy data_frames

Description

Used in particular for compatibility with the tidyverse

Usage

as_df(x, ...)

# S3 method for Coo as_df(x, ...)

# S3 method for Coe as_df(x, ...)

# S3 method for PCA as_df(x, retain, ...)

# S3 method for LDA as_df(x, retain, ...)

Value

a dplyr::tibble()

Arguments

x

an object, typically a Momocs object

...

useless here

retain

numeric for use with scree methods. Defaut to all. If <1, enough axes to retain this proportion of variance; if >1, this number of axes.

See Also

Other bridges functions: bridges, complex, export()

Examples

Run this code
# first, some (baby) objects
b <- bot %>% coo_sample(12)
bf <- b %>% efourier(5, norm=TRUE)
# Coo object
b %>% as_df
# Coe object
bf %>% as_df

# PCA object
bf %>% PCA %>% as_df     # all PCs by default
bf %>% PCA %>% as_df(2) # or 2
bf %>% PCA %>% as_df(0.99) # or enough for 99%

# LDA object
bf %>% LDA(~fake) %>% as_df
# same options apply

Run the code above in your browser using DataLab