Learn R Programming

rio (version 0.1.2)

export: Writing data frame or matrix into a file

Description

This function exports a data frame or matrix into a data file with file format based on the file extension.

Usage

export(x, file = "", format = NULL, row.names = FALSE,
    header = TRUE, ...)

Arguments

x
data frame or matrix to be written into a file.
file
a character string naming a file.
format
a character string code of file format. The following file formats are supported: txt, rds, csv and dta.
row.names
a logical value ('TRUE' or 'FALSE') indicating whether the row names of 'x' are to be written along with 'x'
header
a logical value indicating whether the file contains the names of the variables as its first line.
...
additional arguments for the underlying export functions.

Examples

Run this code
export(iris, "iris.csv")

Run the code above in your browser using DataLab