[R] Logging and writing error messages to a dataframe

2014-09-20 Thread Abhinaba Roy
Hi R-helpers, I intend to record the errors in my R code while calling functions in a dataframe (ERR_LOG, say). I want to use 'try' to identify errors while calling a function,if any.The dataframe(ERR_LOG) will have the following columns : Time : The time at which the function was called

[R] need help

2014-09-20 Thread Ujjwal Kumar
I have the datafram like fxmale head(fxmale) x y D.fx D.ncD.sum1 445350 2463450 1.046935e-06 0.0002627856 0.00026383262 445350 2463950 1.314861e-06 0.0002618268 0.00026314163 445350 2464450 1.435987e-06 0.0002627193 0.00026415534 445350 2464950 1.362894e-06

Re: [R] need help

2014-09-20 Thread Rui Barradas
Hello, Your data.frame only has 2 columns, x and y. The rest are attributes of the column y. To access those attributes you can use something like attr(fxmale, covariates) # This is the one you want attr(fxmale, meanSD) attr(fxmale, boundingbox) and save them in other csv files (most

[R] factor(300000, levels=1:300000) gives NA

2014-09-20 Thread Suharto Anggono Suharto Anggono
In R: factor(30, levels=1:30) [1] NA 30 Levels: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 ... 30 The NA above is undesirable in my view, because 30 is in 1:30. I have just got bitten by it. I have figured out why it happens. The results of

Re: [R] factor(300000, levels=1:300000) gives NA

2014-09-20 Thread Jeff Newmiller
I would say having 30 levels is a bad idea... You should be re-thinking your analysis. If you are still convinced that this is necessary, then do it right: factor(30L, levels=1:30) --- Jeff Newmiller

Re: [R] optim, L-BFGS-B | constrained bounds on parms?

2014-09-20 Thread Ben Bolker
Evan Cooch evan.cooch at gmail.com writes: You could also use Rvmmin that has bounds, or nmkb from dfoptim (though you cannot start on bounds). One 'negative' for dfoptim is that is doesn't automatically generate the Hessian (as far as I can tell). Rather nice to be able to do so

Re: [R] factor(300000, levels=1:300000) gives NA

2014-09-20 Thread William Dunlap
You can work around this issue by matching the types of the the 'x' and 'levels' arguments to factor(): factor(30, as.numeric(29:31)) # both are floating point ('numeric') [1] 3e+05 Levels: 29 3e+05 31 factor(as.integer(30), 29:31) # both are integer [1]

Re: [R] read.table() 1Gb text dataframe

2014-09-20 Thread Henrik Bengtsson
On Fri, Sep 19, 2014 at 10:07 AM, Stephen HK Wong hon...@stanford.edu wrote: Thanks Henrick. Seems it fits my needs. One my question is the argument, length.out=0.10*n, is it randomly taking out 10% ? I found it basically takes every 10th row if I put length.out=0.1*n, and every 100th row if

Re: [R] Converting xy plot arguments into a point argument and fixed x-axis scaling

2014-09-20 Thread David Winsemius
On Sep 19, 2014, at 1:55 PM, nebulo help wrote: Dear all, I have a data.frame xy which I am plotting like in the code below (provided is a small data sample with dummy data that should work). Is there a way how I could convert my xx and yy in the xy plot to a points command so

Re: [R] R2WINBUGS Error message

2014-09-20 Thread Uwe Ligges
On 18.09.2014 08:22, Hanze Zhang wrote: Hi, guys, I am a new user for package R2winbugs. When I run the code a=bugs(...), an error message always comes out, see below: Error in file(con, wb) : cannot open the connection In addition: Warning messages: 1: In file.create(to[okay]) : cannot