Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Date method for impute_below #158

Closed
njtierney opened this issue May 3, 2018 · 3 comments · Fixed by #331
Closed

Add Date method for impute_below #158

njtierney opened this issue May 3, 2018 · 3 comments · Fixed by #331

Comments

@njtierney
Copy link
Owner

shadow_shift and therefore impute_below don't handle date objects:

dat_date <- data.frame(date = as.POSIXct(c(111, 
                                           112,
                                           NA,
                                           NA, 
                                           108,
                                           150,
                                           160),
                                         origin = "1970-01-01"))

# as.numeric(dat_date$date)

naniar::shadow_shift(dat_date$date)
#> Error: shadow_shift does not know how to deal with data of class POSIXctPOSIXt please check your input is more than length one

Created on 2018-05-03 by the reprex package (v0.2.0).

This should be able to be fixed by doing some conversion to a numeric object, then sending it back as a whole integer.

njtierney added a commit that referenced this issue May 3, 2018
@njtierney
Copy link
Owner Author

One thing to keep in mind here is:

  • How do we find out what the original date origin was?
  • Just how many date types are there?

@njtierney njtierney added this to the V0.4.0 milestone Jun 5, 2018
@njtierney njtierney modified the milestones: V0.4.0, V0.5.0 Sep 3, 2018
@njtierney
Copy link
Owner Author

It seems reasonable to convert the date to numeric and then coerce back to a date

@njtierney njtierney modified the milestones: V0.5.0, V0.6.0, V0.7.0 Oct 30, 2019
@njtierney njtierney changed the title shadow-shift / impute-below doesn't handle dates Add Date method for impute_below Apr 24, 2023
njtierney added a commit that referenced this issue May 1, 2023
- Convert to numeric, then impute and convert back to relevant class
- add tests for geom_miss_point() and other dates
- Resolves #158
@njtierney
Copy link
Owner Author

There are three extra methods now:

  • POSIXct
  • POSIXlt
  • Date

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant