[R] Parameters estimation for extreme value models

2013-05-26 Thread assaedi76 assaedi76
Thanks in advance R users   I have time series data and I need to estimate the parameters involved in three different models for generalized extreme values   Model 1:  a, b, c are constants.   Model 2: a(t)=B0+B1 t, but  b, c are constants   Model 3: c(t)= Exp(B0+B1 t)  but a, b are

Re: [R] Parameters estimation for extreme value models

2013-05-26 Thread Jeff Newmiller
Well, then, you had better get busy and stop posting here. To learn why, read the Posting Guide. Some pointers: a) No homework help here. b) No posting in HTML. c) This list is for questions about R, not statements about your needs.

Re: [R] curiosity: next-gen x86 processors and FP32?

2013-05-26 Thread Jeff Newmiller
I am no HPC expert, but I have been computing for awhile. There are already many CPU-specific optimizations built into most compilers used to compile the R source code. Anyone sincerely interested in getting work done today should get on with their work and hope that most of the power of new

[R] load ff object in a different computer

2013-05-26 Thread Djordje Bajic
Hi all, I am having trouble loading a ff object previously saved in a different computer. I have both files .ffData and .RData, and the first of them is 13Mb large from which I know the data is therein. But when I try to ffload it, checkdir error: cannot create /home/_myUser_

[R] avoiding eval parse with indexing

2013-05-26 Thread Martin Ivanov
Hello, I would like to get an advice on how the notorious eval(parse()) construct could possibly be avoided in the following example. I have an array x, which can have different number of dimensions, but I am only interested in extracting, say, the first element of the first dimension.

Re: [R] When creating a data frame with data.frame() transforms integers into factors

2013-05-26 Thread Bert Gunter
1. Please always cc. the list; do not reply just to me. 2. OK, I see. I ERRED. Had you cc'ed the list, someone might have pointed this out. The correct example reproduces what you saw. z- sample(1:10,30,rep=TRUE) table(z) w - data.frame(table(z)) w z Freq 1 12 2 23 3 31

Re: [R] What does this say? Error in rep((Intercept), nrow(a0)) : invalid 'times' argument

2013-05-26 Thread Bert Gunter
Mike: On Sat, May 25, 2013 at 7:24 PM, C W tmrs...@gmail.com wrote: Thomas, thanks for the cool trick. I always thought browser() was the only thing existed, apparently not. Which you would have known had you read the docs! See section 9 on Debugging in the R Language Definition Manual --

Re: [R] load ff object in a different computer

2013-05-26 Thread Milan Bouchet-Valat
Le dimanche 26 mai 2013 à 13:53 +0200, Djordje Bajic a écrit : Hi all, I am having trouble loading a ff object previously saved in a different computer. I have both files .ffData and .RData, and the first of them is 13Mb large from which I know the data is therein. But when I try to ffload

Re: [R] avoiding eval parse with indexing

2013-05-26 Thread Berend Hasselman
On 26-05-2013, at 15:56, Martin Ivanov tra...@abv.bg wrote: Hello, I would like to get an advice on how the notorious eval(parse()) construct could possibly be avoided in the following example. I have an array x, which can have different number of dimensions, but I am only interested in

Re: [R] avoiding eval parse with indexing

2013-05-26 Thread Bert Gunter
Martin: Well, assuming I understand, one approach would be to first get the dim attribute of the array and then create the appropriate call using that: z - array(1:24,dim=2:4) d - dim(z) ix -lapply(d[-c(1,1)],seq_len) do.call([, c(list(z),1,1,ix)) [1] 1 7 13 19 Is that what you want? --

Re: [R] avoiding eval parse with indexing

2013-05-26 Thread Florent D.
library(abind) asub(x, 1, 1) On Sun, May 26, 2013 at 10:43 AM, Bert Gunter gunter.ber...@gene.com wrote: Martin: Well, assuming I understand, one approach would be to first get the dim attribute of the array and then create the appropriate call using that: z - array(1:24,dim=2:4) d -

[R] Setting default graphics device options

2013-05-26 Thread Vishal Belsare
Hi, Is it possible to : [1] set a default location to plot graphs in png format with specific dimensions resolution. I want to plot to a directory which is a shared on the network (samba share), so as to view the plots from a different machine. [2] call dev.off() 'automagically' after a call

Re: [R] avoiding eval parse with indexing

2013-05-26 Thread arun
  the code returns Error:  do.call([, c(list(z),1,1,ix)) #Error in 1:24[1, 1, 1:3, 1:4] : incorrect number of dimensions May be something is missing. A.K. - Original Message - From: Bert Gunter gunter.ber...@gene.com To: Martin Ivanov tra...@abv.bg Cc: r-help@r-project.org Sent:

Re: [R] avoiding eval parse with indexing

2013-05-26 Thread arun
Hi, You could use: library(abind) #using Berend's and Bert's example x1 - array(runif(9),dim=c(3,3)) x2 - array(runif(8),dim=c(2,2,2)) z - array(1:24,dim=2:4) #applying your code:   eval(parse(text=paste0(x1[1,paste(rep(,,length(dim(x1))-1),collapse=),]))) #[1] 0.6439062 0.7139397 0.6017418

[R] [Fw: Re: avoiding eval parse with indexing ]

2013-05-26 Thread Martin Ivanov
---BeginMessage--- Dear Mr Gunter, with a slight correction: z - array(1:24,dim=2:4) d - dim(z) ix - lapply(d[-1], seq_len) do.call([, c(list(z),1,ix)) [,1] [,2] [,3] [,4] [1,]17 13 19 [2,]39 15 21 [3,]5 11 17 23 your suggestion worked and is exactly what

Re: [R] curiosity: next-gen x86 processors and FP32?

2013-05-26 Thread ivo welch
I think this is mostly but not fully correct. most users are better off with double precision most of the time...but not all of the time if the speedup and memory savings are 4 and 2, respectively. algorithm inefficiency may well be true, too---but if I spend one week of my time (or even 3 days)

Re: [R] avoiding eval parse with indexing

2013-05-26 Thread Martin Ivanov
Dear Arun, Thank You very much, your suggestion also works and seems to also be more convenient. I think though, that Mr Gunter's suggestion should be more efficient, as it uses directly the Extract operator. Thank You all very much for Your responsiveness. R does have a wonderful

Re: [R] avoiding eval parse with indexing

2013-05-26 Thread arun
Hi, Another way would be: library(arrayhelpers)  slice(aperm(x1,c(2,1)),j=1) #[1] 0.6439062 0.7139397 0.6017418  slice(aperm(x2,c(2,1,3)),j=1) #    [,1]  [,2] #[1,] 0.026671344 0.2116831 #[2,] 0.003903368 0.1551140   slice(aperm(z,c(2,1,3)),j=1) # [,1] [,2] [,3] [,4] #[1,]    1   

Re: [R] SAPPLY function for COLUMN NULL

2013-05-26 Thread arun
colnames(dd) #[1] col1 colb null_vector- colnames(dd) sapply(null_vector,makeNull,dd) # col1 colb #[1,]   NA    4 #[2,]    2   NA #[3,]    3    2 #[4,]    4   NA #[5,]    1    4 #[6,]   NA    5 #[7,]    1    6 A.K. I am trying to make a column value in a dataframe = NA if there is a 0 or

Re: [R] Setting default graphics device options

2013-05-26 Thread Henrik Bengtsson
Hi, see the R.devices package [http://cran.r-project.org/web/packages/R.devices/]. FYI, there is a vignette [R.devices-overview.pdf], but for some reason it's hard find. However it is there: help.start() - R.devices - 'User guides, package vignettes and other documentation.' -

Re: [R] avoiding eval parse with indexing: Correction

2013-05-26 Thread Bert Gunter
Yes, for the record, the typo in my earlier post is corrected below. (Martin's previous correction both corrected and slightly changed what I provided). -- Bert On Sun, May 26, 2013 at 7:43 AM, Bert Gunter bgun...@gene.com wrote: Martin: Well, assuming I understand, one approach would be to

Re: [R] Setting default graphics device options

2013-05-26 Thread Henrik Bengtsson
Sorry, forgot to add: Hi, [a somewhat different approach but] see the R.devices package /Henrik On Sun, May 26, 2013 at 10:14 AM, Henrik Bengtsson h...@biostat.ucsf.edu wrote: Hi, see the R.devices package [http://cran.r-project.org/web/packages/R.devices/]. FYI, there is a vignette

Re: [R] When creating a data frame with data.frame() transforms integers into factors

2013-05-26 Thread António Brito Camacho
Hello Bert. I didn't reply to the list because i forgot. I hit reply instead of reply all Thanks for your example. I understood now that i was trying to do something that didn't made sense and that was why it failed. I should have used an histogram do do a graph of the frequency of each

Re: [R] Mapping GWR Results in R

2013-05-26 Thread Roger Bivand
Patrick Likongwe patricklikongwe at yahoo.co.uk writes: Dear Team, Help me out here. I have managed to run a Geographically Weighted Regression in R with all results coming up. The problem now comes in mapping the parameter estimates and the t values that are significant in the model. My

Re: [R] load ff object in a different computer

2013-05-26 Thread Djordje Bajic
i *SOLVED* Thanks Milan, I have receivd some feedback externally to the list and managed to solve the issue. I saved the document as follows: x.Arr - ff(NA, dim=rep(ngen,3), vmode=double) ffsave (x.Arr, file=x.Arr) finalizer(x.Arr) - delete The problem was related to the rootpath argument. As

Re: [R] Boundaries of consecutive integers

2013-05-26 Thread Steve Taylor
How's this: big.gap = diff(test) 1 cbind(test[c(TRUE, big.gap)], test[c(big.gap, TRUE)]) -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Lizzy Wilbanks Sent: Tuesday, 14 May 2013 1:18p To: r-help@r-project.org Subject: [R]