Learn R Programming

Momocs (version 1.4.1)

export: Exports Coe objects and shapes

Description

Writes a .txt or .xls or whatever readable from a single shape, a Coe, or a PCA object, along with individual names and $fac.

Usage

export(x, file, sep, dec)

Value

an external file

Arguments

x

a Coe or PCA object

file

the filenames data.txt by default

sep

the field separator string to feed write.table). (default to tab) tab by default

dec

the string to feed write.table) (default ".") by default.

See Also

Other bridges functions: as_df(), bridges, complex

Examples

Run this code
# Will write (and remove) files on your working directory!
if (FALSE) {
bf <- efourier(bot, 6)
# Export Coe (here Fourier coefficients)
export(bf) # data.txt which can be opened by every software including MS Excel

# If you come from a country that uses comma as decimal separator (not recommended, but...)
export(bf, dec=',')
export(bf, file='data.xls', dec=',')

# Export PCA scores
bf %>% PCA %>% export()

# for shapes (matrices)
# export(bot[1], file='bot1.txt')

 # remove these files from your machine
 file.remove("coefficients.txt", "data.xls", "scores.txt")
}

Run the code above in your browser using DataLab