Re: [R] Error in png: unable to start png() device

2011-04-22 Thread Patrick McKann
Smug condescension to an admitted newb asking for help is a sign of ... smug condescension. Don't confuse a lack of technical knowledge with laziness or stupidity just because you happen to be technically knowledgable. I was just asking for a little help and maybe a discussion of what could be go

Re: [R] Error in png: unable to start png() device

2011-04-22 Thread Patrick McKann
d mention in my first post that I was running R 2.13.0. Thanks for taking the time to respond-- Patrick On Fri, Apr 22, 2011 at 5:17 AM, Uwe Ligges wrote: > On 21.04.2011 22:32, Patrick McKann wrote: > >> I don't know if anyone is reading this, but I have more information now. >

[R] Error in png: unable to start png() device

2011-04-21 Thread Patrick McKann
I don't know if anyone is reading this, but I have more information now. I can run the same script on my other computer over and over, change the height, width and res, and it works every time. But on the faulty computer, I can open R, open the script, and run it and it works. I can re-run it an

[R] Error in png: unable to start png() device

2011-04-21 Thread Patrick McKann
Hello. I have made many pngs in the past, but started having trouble with them yesterday. I just downloaded R 2.13.0 this morning, and was able to make some pngs earlier this morning. Now I am trying to remake them, but get the same error message I got yesterday: > u='in' > w=10.5 > h=8 > png('

[R] Combining the results from two simple linear regression models

2011-02-07 Thread Patrick McKann
Hi all. This is more of a stats question, I suppose. Let's say I have two separate simple regressions of weight on year from two different datasets. I want to combine the regressions so that I can come up with a single equation for the total weight regressed on year. In reality, there is missin

[R] get() within a command, specifically lmer

2011-01-05 Thread Patrick McKann
Hello all. Why doesn't this work? d=data.frame(y=rpois(10,1),x=rnorm(10),z=rnorm(10),grp=rep(c('a','b'),each=5)) library(lme4) model=lmer(y~x+z+(1|grp),family=poisson,data=d) update(model,~.-z)###works, removes z var='z' update(model,~.-get(var))##doesn't remove z update(model,~. -get(var,pos=d))

[R] as.object: function doesn't exist but I wish it did

2010-12-29 Thread Patrick McKann
I seem to come to this problem alot, and I can find my way out of it with a loop, but I wish, and wonder if there is a better way. Here's an example (lmer1-5 are a series of lmer objects): bs=data.frame(bic=BIC(lmer1,lmer2,lmer3,lmer4,lmer5)$BIC) rownames(bs)=c('lmer1','lmer2','lmer3','lmer4','

[R] WriteXLS error:Error in get(x, envir = envir) : variable names are limited to 256 bytes

2010-12-10 Thread Patrick McKann
Hello all, I don't understand why this won't work. I have entered: WriteXLS(alldata,'test.xls') and I get this error message: Error in get(x, envir = envir) : variable names are limited to 256 bytes. My variable names are not very long, and are accepted by write.csv. alldata is a list contain

[R] How do you calculate DIC from coda files (R2WinBUGS)?

2010-07-21 Thread Patrick McKann
I tried calculating pD as 1/2 variance of the deviance, but I got hugely inflated numbers. Does anybody know how to calculate pD from the coda files output from R2WinBUGS? By the way, 'set DIC' is greyed out for some reason within WinBUGS, so I can't monitor DIC. [[alternative HTML vers

Re: [R] Nesting functions in loops that result in error messages breaking the loop

2010-07-20 Thread Patrick McKann
Thank you so much! And in package 'base' no less...exactly what I needed! On Tue, Jul 20, 2010 at 8:55 AM, David Winsemius wrote: > > On Jul 20, 2010, at 9:44 AM, Patrick McKann wrote: > > Hello all, >> >> I am trying to write a program in R in which I call a f

[R] Nesting functions in loops that result in error messages breaking the loop

2010-07-20 Thread Patrick McKann
Hello all, I am trying to write a program in R in which I call a function multiple times within a loop. The problem is that sometimes the function breaks down while calling another function, and produces an error message that breaks my loop and the program stops. I would like to keep the loop ru