read.simple.csv.named.vector: read.simple.csv.named.vector

View source: R/ReadWriter.R

read.simple.csv.named.vectorR Documentation

read.simple.csv.named.vector

Description

Read in a data frame (csv), and extact a value and a name column, and convert them to a named vector. By default, it assumes the names in the first column and the values excel style named vectors, names in col1, headers SHIFTED. The header should start with a TAB / First column name should be empty.

Usage

read.simple.csv.named.vector(
  file,
  sep = ";",
  col_names = FALSE,
  value_col = 2,
  name_col = 1,
  ...
)

Arguments

file

Path to the *.csv file.

sep

Separator character, Default: ';' alternative: ','.

col_names

Are there column names?, Default: TRUE

value_col

Column number of the values in the input data frame. Default: 2

name_col

Column number of the names in the input data frame. Default: 1

...

Additional arguments passed to read_csv or read_csv2.

See Also

read_delim

Examples

## Not run: 
if (interactive()) {
  # read.simple.csv.named.vector("path/to/my.file.csv")
}

## End(Not run)

vertesy/ReadWriter documentation built on Nov. 24, 2024, 10:40 p.m.