[Rd] 1954 from NA

Gabriel Becker g@bembecker @end|ng |rom gm@||@com
Mon May 24 16:47:28 CEST 2021


Hi Adrian,

I had the same thought as Luke. It is possible that you can develop an
ALTREP that carries around the tagging information you're looking for in a
way that is more persistent (in some cases) than R-level attributes and
more hidden than additional user-visible columns.

The downsides to this, of course, is that you'll in some sense be doing the
same "extra vector for each vector you want tagged NA-s within" under the
hood, and that only custom machinery you write will recognize things as
something other than bog-standard NAs/NaNs.  You'll also have some problems
with the fact that data in ALTREPs isn't currently modifiable without
losing ALTREPness. That said, ALTREPs are allowed to carry around arbitrary
persistent information with them, so from that perspective making an ALTREP
that carries around a "meaning of my NAs" vector of tags in its metadata
would be pretty straightforward.

Best,
~G

On Mon, May 24, 2021 at 7:30 AM Adrian Dușa <dusa.adrian using gmail.com> wrote:

> Hi Taras,
>
> On Mon, May 24, 2021 at 4:20 PM Taras Zakharko <taras.zakharko using uzh.ch>
> wrote:
>
> > Hi Adrian,
> >
> > Have a look at vctrs package — they have low-level primitives that might
> > simplify your life a bit. I think you can get quite far by creating a
> > custom type that stores NAs in an attribute and utilizes vctrs proxy
> > functionality to preserve these attributes across different operations.
> > Going that route will likely to give you a much more flexible and robust
> > solution.
> >
>
> Yes I am well aware of the primitives from package vctrs, since package
> haven itself uses the vctrs_vctr class.
> They're doing a very interesting work, albeit not a solution for this
> particular problem.
>
> A.
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-devel using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

	[[alternative HTML version deleted]]



More information about the R-devel mailing list