Skip to contents

write the data component of an xvg_data object (or multiple objects) to a delimited text file, controlled via the sep parameter rather than file extension detection.

Usage

export_xvg(xvg_data, file, sep = "\t", row.names = FALSE, merge = FALSE, ...)

Arguments

xvg_data

An object of class xvg_data, or a list of xvg_data objects, as returned by read_xvg().

file

Path to the output file (any extension is acceptable).

sep

Field separator (e.g., "\t" for TSV, "," for CSV). Default is "\t".

row.names

Logical, whether to write row names. Default is FALSE.

merge

Logical, whether to merge multiple xvg_data objects before exporting. Default is FALSE.

...

Additional arguments passed to write.table().

Value

    Invisibly returns the path to the written file.

Examples

if (FALSE) { # \dontrun{
xvg <- read_xvg(system.file("extdata/rmsd.xvg", package = "xvm"))
# Export as TSV
export_xvg(xvg, "rmsd.tsv", sep = "\t")
# Export as CSV
export_xvg(xvg, "rmsd.csv", sep = ",")
} # }