paulklemm / rvisidata

Open any dataframe with visidata, a terminal-based spreadsheet application
Other
30 stars 2 forks source link

error when using columns of type `difftime`/`drtn` and `sha256`/`hash` #13

Open n0542344 opened 3 months ago

n0542344 commented 3 months ago

While playing around with vd I discovered that some types of columns are not supported.

This is the case for difftime- and sha256-type columns although it might also be the case for others (but I haven't tested that yet).

Below a small reprex:

iris %>%
  dplyr::mutate(dt = difftime(as.POSIXct(round(Sepal.Length), origin = "2024-04-04"),
                              as.POSIXct(round(Petal.Width), origin = "2024-03-03"),
                              units = "weeks"),
                hash = openssl::sha256(as.character(Petal.Length))) %>%
  dplyr::select(dt, hash) %>%
  # when including the two column types `drtn` and `hash` I get an error
  dplyr::mutate(dt_c = as.character(dt),
                hash_c = as.character(hash)) %>%
  dplyr::glimpse() %>%
  # when removing the two problematic columns it works
  dplyr::select(-dt) %>%
  dplyr::select(-hash) %>%
  rvisidata::vd()

Any idea why that could be the case?

I assume that this is not a problem of rvisidata but might be of the underlying visidata-tool but to be honest I lack the insight to verify or falsify that claim.