File: CsvFileFormat.Rd

package info (click to toggle)
apache-arrow 23.0.1-1
  • links: PTS
  • area: main
  • in suites: sid
  • size: 76,220 kB
  • sloc: cpp: 654,608; python: 70,522; ruby: 45,964; ansic: 18,742; sh: 7,365; makefile: 669; javascript: 125; xml: 41
file content (41 lines) | stat: -rw-r--r-- 1,497 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dataset-format.R
\name{CsvFileFormat}
\alias{CsvFileFormat}
\title{CSV dataset file format}
\value{
A \code{CsvFileFormat} object
}
\description{
A \code{CSVFileFormat} is a \link{FileFormat} subclass which holds information about how to
read and parse the files included in a CSV \code{Dataset}.
}
\section{Factory}{

\code{CSVFileFormat$create()} can take options in the form of lists passed through as \code{parse_options},
\code{read_options}, or \code{convert_options} parameters.  Alternatively, readr-style options can be passed
through individually.  While it is possible to pass in \code{CSVReadOptions}, \code{CSVConvertOptions}, and \code{CSVParseOptions}
objects, this is not recommended as options set in these objects are not validated for compatibility.
}

\examples{
\dontshow{if (arrow_with_dataset()) withAutoprint(\{ # examplesIf}
# Set up directory for examples
tf <- tempfile()
dir.create(tf)
on.exit(unlink(tf))
df <- data.frame(x = c("1", "2", "NULL"))
write.table(df, file.path(tf, "file1.txt"), sep = ",", row.names = FALSE)

# Create CsvFileFormat object with Arrow-style null_values option
format <- CsvFileFormat$create(convert_options = list(null_values = c("", "NA", "NULL")))
open_dataset(tf, format = format)

# Use readr-style options
format <- CsvFileFormat$create(na = c("", "NA", "NULL"))
open_dataset(tf, format = format)
\dontshow{\}) # examplesIf}
}
\seealso{
\link{FileFormat}
}