[R] weird behavior with the 3rd root....

2008-10-26 Thread Juan Manuel Barreneche
Well, this is what i got... -0.084121928394^(1/3) [1] -0.438163696867656 (-0.084121928394)^(1/3) [1] NaN and i don't have a clue of why this happens or how to avoid it, any suggestions? thank you, Juan __ R-help@r-project.org mailing list

[R] address (nil), cause 'memory not mapped'

2008-08-19 Thread Juan Manuel Barreneche
Dear users, I got this problem and i don't have a clue of what it could be happening... The context: i'm running a loop in which i extract information from a raster map (I work with GRASS and R, using spgrass6 package), and rearrange it to create a matrix. I've tried it with small maps and it

Re: [R] address (nil), cause 'memory not mapped'

2008-08-19 Thread Juan Manuel Barreneche
just to mention that the loop was already running for about 20 hours... Juan On Tue, Aug 19, 2008 at 6:31 PM, Juan Manuel Barreneche [EMAIL PROTECTED]wrote: Dear users, I got this problem and i don't have a clue of what it could be happening... The context: i'm running a loop in which i

[R] problem with save function

2008-08-18 Thread Juan Manuel Barreneche
Hello list! i write because i'm having a strange problem with the save function, here an example: x - stats::runif(20) y - list(a = 1, b = TRUE, c = oops) save(x, y, file = xy.Rdata) xy - load(xy.Rdata) xy [1] x y why does this happens, when: x [1] 0.96586833 0.60340508 0.23465887

Re: [R] problem with save function

2008-08-18 Thread Juan Manuel Barreneche
the help for load(); note the ``Value'' section. cheers, Rolf Turner On 19/08/2008, at 11:51 AM, Juan Manuel Barreneche wrote: Hello list! i write because i'm having a strange problem with the save function, here an example: x - stats::runif(20) y

Re: [R] Fit a sine to data

2008-05-23 Thread Juan Manuel Barreneche
i guess nls or gnls should work JM El Viernes, 23 de Mayo de 2008 10:47, Zroutik Zroutik escribió: Dear R-users, I'd like to fit a sine function to my data. The result should have a format (and thus the formula, too) y ~ a + sin(x+b) where y and x are vectors, and a and b are (yet)

Re: [R] Plotting 3 Time Series

2008-05-22 Thread Juan Manuel Barreneche
Hi ngupta: i didn't get what you mean with If B than xts..If T yts... i suppose that you want to plot the prices of type A, then the prices of type B and so on... # well, to extract prices of tipe A, you can use A - which(table[,1] == A) # and then A.prices - table[,2][A] hope that helps, JM

Re: [R] R for loop question

2008-05-20 Thread Juan Manuel Barreneche
I had to do the same thing many times, i usually use a combination of the functions eval, parse and sprinf, as below: k - 1 for (i in 1:length(stats$hour)) { eval(parse(text=sprintf(x%s - dataset[%s,(3:15)], i, k))) k - k+1 } what it does is: eval(parse(text=STRING)) is a way to execute

Re: [R] Importing data

2008-05-07 Thread Juan Manuel Barreneche
i usually import data from exel, using read.table or read.csv (which implies that i have to save exel files as .txt or .csv) JM El Miércoles, 7 de Mayo de 2008 11:25, John Kane escribió: First step would be to read the manual on the R site R Data Import/Export describes the import and export

Re: [R] duplicate rows in a matrix

2007-11-02 Thread Juan Manuel Barreneche
My sugestion (for an alphabetically ordered output) AA - rbind(A,A) AA - AA[order(AA[,1]), ] ## so your matrix gets alphabetically ordered JM On Fri, 2007-11-02 at 09:04 -0700, Silvia Lipski wrote: Hi! Is there a fast way to duplicate rows in a matrix? I would like to do the following:

Re: [R] find overlap between intervals - Correction

2007-10-31 Thread Juan Manuel Barreneche
I'm not sure if i got the idea of what you want. At fist i thought that you wanted this output: Output: 290 380 380 440 440 443 443 468 to get it, you can use the following function: intervals - function(Input) { all - c(Input$Start, Input$End) numbers -