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.
Arguments
- xvg_data
An object of class
xvg_data
, or a list ofxvg_data
objects, as returned byread_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()
.
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 = ",")
} # }