[RkWard-devel] Length and NAs

Stefan Roediger stefan_roediger at gmx.de
Thu Mar 22 09:36:21 UTC 2007


Am Donnerstag, 22. März 2007 01:01 schrieb Thomas Friedrichsmeier:
> Hi,
>
> especially Stefan will hate me for this,
> moments tests, I came across this issue, which applies to a whole lot of
> plugins:
>
> I think there is a bit of a usability problem with the "length" option(s):
> The problem is that it's not immediately obvious, whether the length shown
> is the length including NAs, or without NAs. I think it's especially
> pronounced, when length is shown, but NAs are not. In this case, I think a
> reasonable assumption for a user would be to think that this is the length
> excluding any NAs.
>

Oh, that's funny. I, as user, would assume that length shows everything 
including NAs. That's way I introduced show NAs. ;)
But of-course one can also see it that way.

> To alleviate this problem, I suggest a relatively simple solution, which
> would have to be applied to a whole lot of plugins, however: Instead of
> providing separate options for showing length and NAs, provide just one
> option, which will show or hide both values at once. The reasoning is, that
> if NAs are always shown alongside length, the user should at least become
> aware of the potential problem, and not jump to any (wrong) conclusions.
>

Well this was the initial idea but I didn't want to make the output to 
verbose. It's hard to tell what users need. I myself usually check my data 
before I run a certain test or at least try to figure out if the data are 
useable. For some packages NAs are no issue for others they are.

> I'm willing to walk through all the existing plugins and change them
> accordingly. However, before I do so, I'd like to ask:
> a) Any objections?

No. I wanted to do some bug hunting at the weekend when I off-line (from today 
on). But I think your changes don't change much and I can add my.

> b) While I'm at it, should we perhaps change the length option(s) to show
> length excluding NAs, everywhere? I guess, probably not, but if you think
> we should, then now would be a good occasion to voice your preference. c)
> Is there a good reason for keeping counting the NAs as
> 	length (which (is.na (x)))
> ? Otherwise I'd change this to
> 	sum (is.na (x))
> which is shorter, and should be slightly more efficient.
>

No opinion here. "shorter" and "slightly more efficient" sound good to me. ;)

> Regards
> Thomas

Regards
Stefan




More information about the Rkward-devel mailing list