Message-ID: <CANVKczP1-uBx7wwjOzsLBPAyAQAg-NxF0A3yqV9C78DLvH8-vg@mail.gmail.com>
Date: 2013-07-05T22:55:02Z
From: Barry Rowlingson
Subject: should the text for RIGHT_ASSIGN be -> in getParseData()?
In-Reply-To: <b5a14bcd6c2142a6a9b48564eaf61bbd@EX-0-HT0.lancs.local>
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