From olafm at statistik.tu-dortmund.de  Mon Oct  4 01:13:28 2010
From: olafm at statistik.tu-dortmund.de (Olaf Mersmann)
Date: Mon, 4 Oct 2010 01:13:28 +0200
Subject: [Rd] tabulate() does not check for input bounds
In-Reply-To: <AANLkTiknfbMgqMO18f47s1_skf_+fpp5_mrNV83QS5t9@mail.gmail.com>
References: <AANLkTiknfbMgqMO18f47s1_skf_+fpp5_mrNV83QS5t9@mail.gmail.com>
Message-ID: <477366AD-7E6B-4889-BA03-0A84859CFE91@statistik.tu-dortmund.de>

Dear Simone,

On 04.10.2010, at 01:01, Simone Giannerini wrote:
> it looks like that tabulate() does not check for the bounds of the input.
> Reproducible example:
> 
>> b <- 1:2
>> tabulate(b[1:100])
> [1] 1 1

this looks perfectly reasonable. Consider the result of 

> b <- 1:2
> b[1:100]
  [1]  1  2 NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
 [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA

and check the help page for tabulate (esp. the na.rm argument).

What was your expected result?

Cheers,
Olaf



[Rd] tabulate() does not check for input bounds
Olaf Mersmann