File: csv_read_options.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 (53 lines) | stat: -rw-r--r-- 1,891 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
42
43
44
45
46
47
48
49
50
51
52
53
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/csv.R
\name{csv_read_options}
\alias{csv_read_options}
\title{CSV Reading Options}
\usage{
csv_read_options(
  use_threads = option_use_threads(),
  block_size = 1048576L,
  skip_rows = 0L,
  column_names = character(0),
  autogenerate_column_names = FALSE,
  encoding = "UTF-8",
  skip_rows_after_names = 0L
)
}
\arguments{
\item{use_threads}{Whether to use the global CPU thread pool}

\item{block_size}{Block size we request from the IO layer; also determines
the size of chunks when use_threads is \code{TRUE}.}

\item{skip_rows}{Number of lines to skip before reading data (default 0).}

\item{column_names}{Character vector to supply column names. If length-0
(the default), the first non-skipped row will be parsed to generate column
names, unless \code{autogenerate_column_names} is \code{TRUE}.}

\item{autogenerate_column_names}{Logical: generate column names instead of
using the first non-skipped row (the default)? If \code{TRUE}, column names will
be "f0", "f1", ..., "fN".}

\item{encoding}{The file encoding. (default \code{"UTF-8"})}

\item{skip_rows_after_names}{Number of lines to skip after the column names (default 0).
This number can be larger than the number of rows in one block, and empty rows are counted.
The order of application is as follows:
- \code{skip_rows} is applied (if non-zero);
- column names are read (unless \code{column_names} is set);
- \code{skip_rows_after_names} is applied (if non-zero).}
}
\description{
CSV Reading Options
}
\examples{
\dontshow{if (arrow_with_dataset()) withAutoprint(\{ # examplesIf}
tf <- tempfile()
on.exit(unlink(tf))
writeLines("my file has a non-data header\nx\n1\n2", tf)
read_csv_arrow(tf, read_options = csv_read_options(skip_rows = 1))
open_csv_dataset(tf, read_options = csv_read_options(skip_rows = 1))
\dontshow{\}) # examplesIf}
}