From b.rowlingson at lancaster.ac.uk  Sat Jul  6 00:55:02 2013
From: b.rowlingson at lancaster.ac.uk (Barry Rowlingson)
Date: Fri, 5 Jul 2013 23:55:02 +0100
Subject: [Rd] should the text for RIGHT_ASSIGN be -> in getParseData()?
In-Reply-To: <b5a14bcd6c2142a6a9b48564eaf61bbd@EX-0-HT0.lancs.local>
References: <CANROs4eVNfPjs_D5wb4Hqgy3Axb=88PZ_eGHVAFhTbi-3uT3Tw@mail.gmail.com>
	<51D6AE2B.1060500@gmail.com>
	<93D66B0A-0F6C-4D4B-AA78-F9379C390C2F@gmail.com>
	<252887c8b1864e97a749507eec483c7b@EX-1-HT0.lancs.local>
	<CANVKczO+J5OR3vGCRE0cuT7KfA9y7zQdq_iRjJYkqs=1+3hp4g@mail.gmail.com>
	<E66794E69CFDE04D9A70842786030B931C319123@PA-MBX01.na.tibco.com>
	<b5a14bcd6c2142a6a9b48564eaf61bbd@EX-0-HT0.lancs.local>
Message-ID: <CANVKczP1-uBx7wwjOzsLBPAyAQAg-NxF0A3yqV9C78DLvH8-vg@mail.gmail.com>

On Fri, Jul 5, 2013 at 7:24 PM, peter dalgaard <pdalgd at gmail.com> wrote:

> I have used in with multi-line input, occasionally, though. As in
>
> replicate(10000, {
>    ysim <- rbinom(length(p), n, p)
>    glm(cbind(ysim, n - ysim) ~ x, binomial)$deviance
> })
>
> ... and then you realize that you probably don't want to look at 10000 simulated deviances and add "-> simDev".
>

 Yes, that's kinda cute, but then you realise you don't want to have
to type all that again and it would really be better off in a
function. Can you do something like:

replicate(10000,{
  ysim <- rbinom(length(p), n, p)
glm(cbind(ysim, n - ysim) ~ x, binomial)$deviance
}) -> function()...

 - I don't think so. Once you've started typing, the only way to get
it into a function is going to involve sticking function() at the
start, at which point you can add the foo <-

I guess this is the point where Dirk gets upset and calls me a troll.
I'll shut up. You've convinced me its mostly harmless.

Barry



[Rd] should the text for RIGHT_ASSIGN be -> in getParseData()?
Barry Rowlingson