To answer Henry's question based on the behavior of R, which Erling
advocates, and I too love!!

In R, length of vector (what we'd call list in J) with missing values is
still the actual number of elements in a vector.  Missing value *is* still
a value in a list and it gets counted!  However, it makes no sense to take
a mean/stddev/median unless we handle (acknowledge?) missing values so R
will yield missing value (NA) when you take mean/stddev/median with a
vector with missing values.  Check out this behavior from an interactive R
session:

> x <- 1:10
> x
 [1]  1  2  3  4  5  6  7  8  9 10
> x <- c(x,NA)
> x
 [1]  1  2  3  4  5  6  7  8  9 10 NA
> mean(x)
[1] NA
> mean(x, na.rm=TRUE)
[1] 5.5
> length(x)
[1] 11
> sd(x)
[1] NA
> median(x)
[1] NA
>

IMO, this is a good practice (notice I didn't say right) and helps with
dealing with issues in real world.  No other language that I'm aware of
deals with missing values so consistently, and pragmatically, as R.  And
oh, all of this is described quite clearly in the documentation for R.

On Wed, Sep 20, 2017 at 10:51 AM, Erling Hellenäs <erl...@erlinghellenas.se>
wrote:

> Hi all !
>
> Here is part of the standard. Required exception handling. Things I
> discuss in my post. Is it implemented in J? https://en.wikipedia.org/wiki/
> IEEE_754#Exception_handling
> The floating point standard is obviously used in environments where the
> users can not afford random results, so there must be solutions to the
> problems I mention, which we also can see in this wikipedia article.
>
> Cheers,
> Erling
>
>
> Den 2017-09-20 kl. 16:27, skrev Erling Hellenäs:
>
>> I hope others want to read my post even if Raul discards it as not worthy
>> of comments. /Erling
>>
>>
>> Den 2017-09-20 kl. 12:25, skrev Raul Miller:
>>
>>> This isn't just J - this is the IEEE-754 floating point standard.
>>>
>>> It would be really nice if computers could deal with infinities,
>>> instantly, at no cost. Sadly, though, that's not going to happen.
>>>
>>> FYI,
>>>
>>>
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
>>
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>



-- 
Vijay Lulla, Ph.D.

Assistant Professor,
Dept. of Geography,
Indiana University Purdue University Indianapolis (IUPUI)
425 University Blvd, CA-207C.
Indianapolis, IN-46202
vlu...@iupui.edu

<http://vijaylulla.com>
http://vijaylulla.com
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to