read_csv: Read a csv file

Description Usage Arguments Details Value See Also Examples

View source: R/read_csv.R

Description

Read a csv file via data.table::fread() using a particular set of options, including the ability to transpose the result.

Usage

1
2
3
4
5
6
7
8
read_csv(
  filename,
  sep = ",",
  na.strings = c("NA", "-"),
  comment.char = "#",
  transpose = FALSE,
  rownames_included = TRUE
)

Arguments

filename

Name of input file

sep

Field separator

na.strings

Missing value codes

comment.char

Comment character; rest of line after this character is ignored

transpose

If TRUE, transpose the result

rownames_included

If TRUE, the first column is taken to be row names.

Details

Initial two lines can contain comments with number of rows and columns. Number of columns includes an ID column; number of rows does not include the header row.

The first column is taken to be a set of row names

Value

Data frame

See Also

read_csv_numer()

Examples

1
## Not run: mydata <- read_csv("myfile.csv", transpose=TRUE)

qtl2 documentation built on Oct. 18, 2021, 1:06 a.m.