MilesMcBain / datapasta

On top of spaghetti, all covered in cheese....
https://milesmcbain.github.io/datapasta/
Other
891 stars 58 forks source link

tribble_paste(tibble(x = "")) yields tibble(x = NA) #106

Closed maurolepore closed 4 years ago

maurolepore commented 4 years ago

tribble_paste() with tibble(x = "") gave me a tibble(x = NA). I expected tibble(x = ""). Is this a bug or is my expectation incorrect?

library("tibble")
library("datapasta")
packageVersion("datapasta")
#> [1] '3.1.0'

tribble_paste(tibble(x = ""))
#> tibble::tribble(
#>   ~x,
#>   NA
#>   )

Created on 2019-12-26 by the reprex package (v0.3.0.9001)

MilesMcBain commented 4 years ago

Thanks for this example!

This is an interesting one. It's always made sense to me to do this because if you're copying text from another application like Excel or a webpage table and you get a blank cell - NA is almost cetainly what you want to code that as. So converting for you is a handy convenience.

However over time datapasta has become used more heavily in reprexes where this kind of thing is not convenient. It works counter to what you are trying to do.

I know that there are plans to re-implement the tribble printing within reprex itself, see: https://github.com/tidyverse/reprex/issues/280

This makes me hesitant to pivot toward more transparent printing for reprexes at the moment since that effort would likely be wasted.

maurolepore commented 4 years ago

Thanks! Makes sense.