Skip to contents

Reads only the header and at most n_max data rows. A generic table is deliberately returned as a low-confidence candidate because its biological meaning cannot be inferred safely without an explicit column map.

Usage

cs_detect_format(path, n_max = 50L)

Arguments

path

A delimited table file.

n_max

Maximum number of data rows to inspect after the header.

Value

A data frame with format, score and evidence columns.

Examples

path <- tempfile(fileext = ".csv")
utils::write.csv(data.frame(id = 1, x = 2, y = 3), path, row.names = FALSE)
cs_detect_format(path)
#>   format score
#> 1  table   0.5
#>                                                                evidence
#> 1 Readable delimited table with 3 columns; explicit column_map required