Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@pbrohan
Copy link
Contributor

@pbrohan pbrohan commented Jul 23, 2023

Added as_tibble argument to read_ods.

This presents a bit of an issue with name repair as there are now three ways column names can be repaired:

  1. No column names are given: Here columns are given sequential column names by passing their column number to cellranger::num_to_letter()
  2. Only some column names are given: Here data.frame gives default column names to those missing names in the form "Var.%column_number%"
  3. Duplicate column names are given and as_tibble's name_repair is invoked: Column names are repaired by prepending . and a number sequentially in the order of columns needing to be repaired.

More than one of these can occur, for example importing a sheet containing

1  a    a    <blank>
2  A    B    C

using arguments as_tibble = TRUE, .name_repair = "unique" (a likely common pairing) gives column names

a...1  a...2  Var.3

which is a little hard to predict.

However, this is likely the output users who have previously been using the pipeline

read_ods(file) |> as_tibble()

will have been expecting, and so a change from this would be a significant and unexpected breaking change, even though it might be preferable from a consistency point of view.

@chainsawriot
Copy link
Collaborator

Thank you very much!

@chainsawriot chainsawriot merged commit 0b2b682 into ropensci:v1.9 Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants