Skip to contents

Returns the column names of a string in a delimiter-separated-value format like CSV or TSV.

Usage

dsv_colnames(x, delim = ",", quote = "\"")

Arguments

x

Delimiter-separated string. A character scalar.

delim

Single character used to separate fields within x.

quote

Single character used to quote strings within x. Set to NULL for none.

Value

A character vector of column names.

Examples

"https://raw.githubusercontent.com/tidyverse/readr/master/inst/extdata/mtcars.csv" |>
  httr2::request() |>
  httr2::req_perform() |>
  httr2::resp_body_string() |>
  pal::dsv_colnames()
#>  [1] "mpg"  "cyl"  "disp" "hp"   "drat" "wt"   "qsec" "vs"   "am"   "gear" "carb"