cas.write.csv: Write a CAS Table to a CSV File

View source: R/read_write.R

cas.write.csvR Documentation

Write a CAS Table to a CSV File

Description

This function downloads an in-memory table from the CAS server and saves it as a CSV file that is accesible to R (the client). This function is a convenience wrapper for the R write.csv function.

Usage

cas.write.csv(
  CASTable,
  file = "",
  quote = TRUE,
  eol = "\n",
  na = "NA",
  row.names = TRUE,
  fileEncoding = ""
)

Arguments

CASTable

The instance of the CASTable to save as as a CSV file.

file

An character string that specifies the filename for the CSV file. If you do not specify the file, then the in-memory table name is used with a .csv suffix. This value is passed to write.csv.

quote

An optional logical value or numeric vector. This value is passed to write.csv.

eol

An optional character string that is used as the end-of-line character or characters. This value is passed to write.csv.

na

An optional character string to represent missing values. This value is passed to write.csv.

row.names

An optional logical value or a character vector of row names. This value is passed to write.csv.

fileEncoding

An optional character string that specifies the encoding to use for writing the CSV file. This value is passed to write.csv.

append

An optional logical value This value is passed to write.csv.

sep

An optional character that is used to separate values in the CSV file. This value is passed to write.csv.

dec

An optional character to represent the decimal separator. This value is passed to write.csv.

col.names

An optional logical value or a character vector of column names. This value is passed to write.csv.

qmethod

An optional chracter string that describes how to write embedded quotation marks. This value is passed to write.csv.

Details

This function saves the file on the R client. As an alternative, you can use the cas.table.save generated function to save a server-side CSV file.

See Also

Other functions for saving in-memory data: cas.saveRDS(), cas.write.table(), cas.write.xlsx()

Examples

## Not run: 
# upload a SAS data set to an in-memory table
gold_medals <- cas.read.sas7bdat(s, "/path/to/gold_medals.sas7bdat")

# download the in-memory table as a CSV file
cas.write.csv(gold_medals, "~/gold_medals.csv")


## End(Not run)

sassoftware/R-swat documentation built on Feb. 26, 2024, 8 a.m.