On Tue, 1 Oct 2019, Riccardo (Jack) Lucchetti wrote:
On Tue, 1 Oct 2019, Allin Cottrell wrote:
> On Mon, 30 Sep 2019, Allin Cottrell wrote:
>
> > On Mon, 30 Sep 2019, Riccardo (Jack) Lucchetti wrote:> > Hi all,
> > >
> > > I've had a recurring problem with string-valued series, and I'm
> > > struggling
> > > to find a solution. [...]
> [ plus hansl ]
>
> > Wel, I doubt whether you'd consider the following more elegant than your
> > own
> > version!
> [ plus hansl ]
>
> Sorry, I should have looked at your code more carefully before
> replying. I now see that I pretty much just reinvented what you had.
>
> Anyway, I'm wondering if it might be worth having a built-in function
> to this effect -- maybe stralign(), taking a list argument?
Hmmm
the more I think about this, the more I think we
- ought to get rid of the limitation on assigning to a string-values series
(somehow, don't ask me how)
- ought to have some way to de-stringify a series (that we don't have at the
moment, if I'm not mistaken)
I'm not sure if this is what you have in mind, but
series x = s
gives you a plain numeric series x holding the encoding values of
string-valued series s.
Moreover, it would be nice to have freq and xtab sort the values
alphabetically for string-valued series. I'd love to have a go this myself,
but I'm literally flooded with teaching this week.
OK, that's worth looking into.
Allin