Learn R Programming

gm (version 1.0.2)

export: Export Object

Description

Export an object to various file formats.

Usage

export(x, dir_path, file_name, formats)

# S3 method for Music export(x, dir_path, file_name, formats)

Value

Invisible NULL.

Files with name file_name and with extensions formats are generated in dir_path.

Arguments

x

An object.

dir_path

A single character which specifies the directory to which to export the object.

file_name

A single character which specifies the name of the exported file(s).

formats

A character vector which specifies the file formats. Supported file formats are "mscz", "mscx", "pdf", "png", "svg", "wav", "mp3", "flac", "ogg", "midi", "mid", "musicxml", "mxl", "xml", "metajson", "mlog", "mpos" and "spos".

Methods (by class)

  • Music: export a Music object.

Examples

Run this code
if (interactive()) {
  m <- Music() + Meter(4, 4) + Line(list("C4"), list(4))
  export(m, tempdir(), "x", c("mp3", "png"))
}

Run the code above in your browser using DataLab