njtierney / naniar

Tidy data structures, summaries, and visualisations for missing data
http://naniar.njtierney.com/
Other
650 stars 54 forks source link

Use `vctrs` to establish new classes of data #264

Open njtierney opened 4 years ago

njtierney commented 4 years ago

I think that the new modern approach is to use vctrs::new_vctr

For example: https://github.com/njtierney/naniar/blob/885de6f95ac8ef638d7e785797b06d842655a3e2/R/shade.R#L16

Could / should probably be replaced with something like what @mitchelloharawild has written here:

https://github.com/mitchelloharawild/distributional/blob/e1fe78652c74a969e0c0d505b12445d5f36af664/R/distribution.R#L17

See also: https://vctrs.r-lib.org/articles/s3-vector.html