dido_read_delim: Lit un fichier CSV

View source: R/dido-csv.R

dido_read_delimR Documentation

Lit un fichier CSV

Description

Cette fonction utilise directement readr::read_delim en enlevant la détection du type des colonnes.

Usage

dido_read_delim(
  file,
  delim = NULL,
  quote = "\"",
  escape_backslash = FALSE,
  escape_double = TRUE,
  locale = readr::default_locale(),
  comment = "",
  trim_ws = FALSE,
  skip = 0,
  n_max = Inf,
  skip_empty_rows = TRUE
)

Arguments

file

Either a path to a file, a connection, or literal data (either a single string or a raw vector).

Files ending in .gz, .bz2, .xz, or .zip will be automatically uncompressed. Files starting with http://, https://, ftp://, or ftps:// will be automatically downloaded. Remote gz files can also be automatically downloaded and decompressed.

Literal data is most useful for examples and tests. To be recognised as literal data, the input must be either wrapped with I(), be a string containing at least one new line, or be a vector containing at least one string with a new line.

Using a value of clipboard() will read from the system clipboard.

delim

Single character used to separate fields within a record.

quote

Single character used to quote strings.

escape_backslash

Does the file use backslashes to escape special characters? This is more general than escape_double as backslashes can be used to escape the delimiter character, the quote character, or to add special characters like \\n.

escape_double

Does the file escape quotes by doubling them? i.e. If this option is TRUE, the value """" represents a single quote, \".

locale

The locale controls defaults that vary from place to place. The default locale is US-centric (like R), but you can use locale() to create your own locale that controls things like the default time zone, encoding, decimal mark, big mark, and day/month names.

comment

A string used to identify comments. Any text after the comment characters will be silently ignored.

trim_ws

Should leading and trailing whitespace (ASCII spaces and tabs) be trimmed from each field before parsing it?

skip

Number of lines to skip before reading data. If comment is supplied any commented lines are ignored after skipping.

n_max

Maximum number of lines to read.

skip_empty_rows

Should blank rows be ignored altogether? i.e. If this option is TRUE then blank rows will not be represented at all. If it is FALSE then they will be represented by NA values in all the columns.

Details

Certaines variables peuvent avoir des valeurs secrétisées représentées par la valeur secret, la détection automatique de readr n'est donc pas fiable et est désactivé à ce niveau. La détection automatique est faite dans la fonction dido_csv().

Value

un tibble dont toutes les colonnes sont de type chr

Examples

## Not run: 
data <- dido_read_delim("vignettes/exemple.csv")

## End(Not run)

nbc/didoscalim documentation built on Sept. 12, 2022, 10:17 a.m.