[Rd] 1954 from NA

Gabriel Becker g@bembecker @end|ng |rom gm@||@com
Tue May 25 00:23:58 CEST 2021


Hi All,

So there is a not particularly active, but closely curated (ie everything
on there should be good in terms of principled examples) github
organization of ALTREP examples: https://github.com/ALTREP-examples.
Currently there are two examples by Luke (including a package version of
the memory map ALTREP he wrote) and one by me.

To elaborate a bit more it looks like you could have read-only vectors with
tagged NAs, because despite my incorrect recollection, It looks like
Extract_subset IS hooked up, so subsetting an ALTREP can, depending on the
altrep class, give you another ALTREP.

They would effectively be subsettable but not mutable, though,
because setting elements in an ALTREP vector still wipes its altrepness.
This is unfortunate but an intentional design decision that itself
currently appears immutable,if you'll excuse the pun, last I heard.

I understand that that is a relatively sizable caveat, but ce la vie

Assuming that things would be useful with that caveat I can try to put a
proof of concept example into that organization that could works as the
starting board for a deeper collaboration soon. I think I have in my head a
way to approach it.

~G

On Mon, May 24, 2021 at 3:00 PM Nicholas Tierney <nicholas.tierney using gmail.com>
wrote:

> Hi all,
>
> When first hearing about ALTREP I've wondered how it might be able to be
> used to store special missing value information - how can we learn more
> about implementing ALTREP classes? The idea of carrying around a "meaning
> of my NAs" vector, as Gabe said, would be very interesting!
>
> I've done a bit on creating "special missing values", as done in SPSS,
> SAS, and STATA, here:
> http://naniar.njtierney.com/articles/special-missing-values.html  (Note
> this approach requires carrying a duplicated dataframe of missing data
> around with the data - which I argue makes it easier to reason with, at the
> cost of storage. However this is just my approach, and there are others out
> there).
>
> Best,
>
> Nick
>
> On Tue, 25 May 2021 at 01:16, Adrian Dușa <dusa.adrian using gmail.com> wrote:
>
>> On Mon, May 24, 2021 at 5:47 PM Gabriel Becker <gabembecker using gmail.com>
>> wrote:
>>
>> > 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.
>> >
>>
>> Oh... now that is extremely interesting.
>> It is the first time I came across the ALTREP concept, so I need to study
>> the way it works before saying anything, but definitely something to
>> consider.
>>
>> Thanks so much for the pointer,
>> Adrian
>>
>>         [[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