stemangiola / tidygate

Label elements within user drawn gates
22 stars 3 forks source link

Use a character `"0"` as the replacement value #15

Closed DavisVaughan closed 2 years ago

DavisVaughan commented 2 years ago

We are updating tidyr::replace_na() to utilize vctrs, and that results in slightly stricter / more correct type conversions. See https://github.com/tidyverse/tidyr/pull/1219

We noticed in revdeps that this package broke. An easy way to see this is by installing the PR mentioned above and running:

library(tidygate)

gate(
  tidygate::tidygate_data,
  .element = c(`ct 1`, `ct 2`),
  Dim1, Dim2,
  gate_list = tidygate::gate_list
)
#> Warning: `gate()` was deprecated in tidygate 0.3.0.
#> Please use `gate_chr()` instead.
#> This warning is displayed once every 8 hours.
#> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was generated.
#> Error: Problem with `mutate()` column `gate`.
#> ℹ `gate = replace_na(gate, 0)`.
#> x Can't convert `replace` <double> to match type of `data` <character>.

Created on 2021-11-18 by the reprex package (v2.0.1)

The problem boils down to the fact that you are calling replace_na(<chr>, replace = 0), where the column you are replacing in (gate) is a character column, but the replacement value is a numeric value. This is no longer allowed. It looks like you actually did want a character column here for gate (based on the unite() call earlier, which returns a character vector), so I have changed 0 to "0".

We would greatly appreciate if you could merge this PR and submit a patch release of your package to CRAN so we can send tidyr in!

stemangiola commented 2 years ago

Thanks @DavisVaughan ,

would you mind editing also the other instance at https://github.com/stemangiola/tidygate/blob/b4d1d8f1b2fd218df092c0c5b615ce03e63d0e32/R/functions_OLD.R#L325

DavisVaughan commented 2 years ago

Done!

DavisVaughan commented 2 years ago

Hi @stemangiola, do you plan to send tidygate to CRAN soon? It still shows up in our revdeps and we plan to send tidyr in soon. Thanks!

stemangiola commented 2 years ago

I will today

stemangiola commented 2 years ago

Hello @DavisVaughan I tried to submit but CRAN is on holidays

Submit a package to CRAN -- The submission team is on vacation till Jan 3, 2022. During this time the submission of packages is not possible. Sorry for any inconvenience.

I doubt you guys will be able to submit before the 3rd.

I will try to get it done on that day.

stemangiola commented 2 years ago

On CRAN today.

DavisVaughan commented 2 years ago

@stemangiola your package still shows up in revdep checks for tidyr. It seems like the patch from this PR did not make it into the CRAN version of your package. i.e. the CRAN version of your package still errors with the example at the top of this PR, and if you download the source code off CRAN then it doesn't have this patch.

Can you please check on this for us?

We plan to release tidyr this week!

stemangiola commented 2 years ago

Apologies @DavisVaughan, not sure what happened. Now a double-checked new version 0.4.9 is submitted to CRAN.