I'm trying out readr and I like what I see :)
I'm missing a way to specify "I let you" choose the best class for the column, cf.
> cat("a\t2\t1.2", file="foo.tsv")
> str(read.table("foo.tsv", colClasses=c("character", "integer", NA)))
'data.frame': 1 obs. of 3 variables:
$ V1: chr "a"
$ V2: int 2
$ V3: num 1.2
> str(readr::read_tsv("foo.tsv", col_names=FALSE))
Classes 'tbl_df', 'tbl' and 'data.frame': 1 obs. of 3 variables:
$ X1: chr "a"
$ X2: int 2
$ X3: num 1.2
> str(readr::read_tsv("foo.tsv", col_names=FALSE, col_types="cid"))
Classes 'tbl_df', 'tbl' and 'data.frame': 1 obs. of 3 variables:
$ X1: chr "a"
$ X2: int 2
$ X3: num 1.2
but ideally also something like:
> str(readr::read_tsv("foo.tsv", col_names=FALSE, col_types="ci?"))
$ X1: chr "a"
$ X2: int 2
$ X3: num 1.2
PS. I picked '?' as in R.utils::colClasses("ci?") == c("character", "integer", "NA"). Related and minor: Did you consider using another symbol than underscore for skipping a column, because it becomes hard to count when there are several of them in a row, e.g. c______i v. c------i.
I'm trying out
readrand I like what I see :)I'm missing a way to specify "I let you" choose the best class for the column, cf.
but ideally also something like:
PS. I picked '?' as in
R.utils::colClasses("ci?") == c("character", "integer", "NA"). Related and minor: Did you consider using another symbol than underscore for skipping a column, because it becomes hard to count when there are several of them in a row, e.g.c______iv.c------i.