From sgiannerini at gmail.com  Mon Oct  4 14:50:51 2010
From: sgiannerini at gmail.com (Simone Giannerini)
Date: Mon, 4 Oct 2010 14:50:51 +0200
Subject: [Rd] tabulate() does not check for input bounds
In-Reply-To: <477366AD-7E6B-4889-BA03-0A84859CFE91@statistik.tu-dortmund.de>
References: <AANLkTiknfbMgqMO18f47s1_skf_+fpp5_mrNV83QS5t9@mail.gmail.com>
	<477366AD-7E6B-4889-BA03-0A84859CFE91@statistik.tu-dortmund.de>
Message-ID: <AANLkTimBf=dK1kRATU25=Rk6fBQvc-QBaa=eBLvva6hj@mail.gmail.com>

Dear Olaf,

thanks for your reply, at first sight I did not link this behaviour to
that subsetting feature that I must admit I am not used to.

Ciao

Simone



On Mon, Oct 4, 2010 at 1:13 AM, Olaf Mersmann
<olafm at statistik.tu-dortmund.de> wrote:
> 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
>
>



-- 
______________________________________________________

Simone Giannerini
Dipartimento di Scienze Statistiche "Paolo Fortunati"
Universita' di Bologna
Via delle belle arti 41 - 40126? Bologna,? ITALY
Tel: +39 051 2098262? Fax: +39 051 232153
http://www2.stat.unibo.it/giannerini/



[Rd] tabulate() does not check for input bounds
Simone Giannerini