vincentarelbundock / Rdatasets

A collection of datasets originally distributed in R packages
https://vincentarelbundock.github.io/Rdatasets
Other
323 stars 435 forks source link

data sets listed with a single row - non-rectangular data? #38

Closed bbolker closed 2 months ago

bbolker commented 2 months ago

There are 15 to 20 data sets in the collection (didn't count exactly) that are listed as having a single row. In one particular case (and likely the rest), this is because the data sets are not in a tabular/rectangular format. e.g. quantreg::Peirce is a list of (x, y, date) lists where x and y match in length and date is a scalar ...

The actual contents of the CSV file in that case:

Error in (function (..., row.names = NULL, check.rows = FALSE, check.names = TRUE, : arguments imply differing number of rows: 258, 174, 167, 144, 138, 147, 158, 126, 132, 120, 136, 122, 111, 116, 114, 145, 104, 110, 115, 107, 102

vincentarelbundock commented 2 months ago

Thanks for the note. I added some try-catch logic to avoid this particular problem. Peirce no longer appears on the website because it cannot be coerced directly with as.data.frame(). I suppose we could add more complex logic for corner cases like this, but that feels low priority.

bbolker commented 2 months ago

Agreed (about lower priority). Thanks for providing this resource!