[R] readxl question

Ivan Krylov kry|ov@r00t @end|ng |rom gm@||@com
Thu Dec 5 18:43:07 CET 2019


On Thu, 5 Dec 2019 15:39:56 +0000
Thomas Subia <tsubia using imgprecision.com> wrote:

> date <- lapply(files, read_excel, sheet="Sheet1", range=("B5"))
> date_df <- as.data.frame(date)
> trans_date <-t(date_df)
> mydates <- list(trans_date)

This feels a bit excessive for what looks like a one-dimensional string
vector. Why is it needed? Can you get better results with sapply or
vapply (which return vectors, not lists)?

In particular, as.data.frame might be responsible for the name
mangling. Also, your data seems to end up inside the row names. Try
using str() on every step of the transformation to check if that is the
case.

Also check out the .name_repair argument of the read_excel function,
but I think that as.data.frame is part of the problem.

-- 
Best regards,
Ivan



More information about the R-help mailing list