Re: [R] Adding variables

2009-09-27 Thread tzygmund mcfarlane
>   0.05    0.02    0.06 > >> system.time(for(i in 1:1000) rowSums(cbind(mag, station))) >   user  system elapsed >   0.09    0.00    0.10 > > See ?system.time, ?Rprof and http://code.google.com/p/rbenchmark/ > for timing commands. > > On Sat, Sep 26, 2009 at 11:16 AM, tzygmun

Re: [R] Adding variables

2009-09-27 Thread tzygmund mcfarlane
/FAQ/R-FAQ.html#How-do-I-convert-factors-to-numeric_003f > > If the problem were more basic, and you did not know what was in that > dataset then the answer might have bee: > > str(attenu) > > -- > David > > > > > On Sep 27, 2009, at 7:47 AM, tzygmu

Re: [R] Adding variables

2009-09-27 Thread tzygmund mcfarlane
reproducible code) that 'mag' was > a matrix.  If 'station' is a matrix, then > > mag + rowSums(station) > > will work.  If that does not work, then you need to tell us what your > data objects are. > > On Sat, Sep 26, 2009 at 11:39 AM, tzygmund mcfarla

Re: [R] Adding variables

2009-09-26 Thread tzygmund mcfarlane
(mag, station)) # Thanks On Sat, Sep 26, 2009 at 4:30 PM, jim holtman wrote: > Probably more efficient if you remove the 'cbind' which would create a > combined matrix.  Use the following: > > rowSums(mag) + rowSums(station) > > On Sat, Sep 26, 2009 at 11:

[R] Adding variables

2009-09-26 Thread tzygmund mcfarlane
Hi, For very large matrices, is this the most efficient way to add two variables together? # attach(attenu) new<-rowSums(cbind(mag, station)) # Also, could I be directed to some resources for working with very large datasets? Thanks _

Re: [R] Processing strings

2009-09-19 Thread tzygmund mcfarlane
x', 1:3, sep="") > # New suggestion > sapply( Names, function( y ) list( get( y ) ) ) > Best, > Jorge > > On Sat, Sep 19, 2009 at 6:51 PM, tzygmund mcfarlane <> wrote: >> >> Jorge, >> >> Your suggestions produce the names of the matrice

Re: [R] Processing strings

2009-09-19 Thread tzygmund mcfarlane
Ah, apologies. In the backing and forthing, I assigned the names to the matrices. All sorted. Thanks! On Sat, Sep 19, 2009 at 11:55 PM, Duncan Murdoch wrote: > On 19/09/2009 6:51 PM, tzygmund mcfarlane wrote: >> >> Jorge, >> >> Your suggestions produce the names

Re: [R] Processing strings

2009-09-19 Thread tzygmund mcfarlane
;-paste("Table", i, sep="") >   print(get(disp)) > } > # Suggestion 2 > disp <- paste("Table", 1:10, sep="") > sapply(disp, function(x) print( get(x) ) ) > See ?print and ?get for more information. > HTH, > Jorge > > On Sat, Sep 19

[R] Processing strings

2009-09-19 Thread tzygmund mcfarlane
Hi, I am unable to do something fairly simple. I have matrices called Table1,..., Table10. I want to be able to print them using a loop. So I wrote: ## for (i in 1:10){ disp<-paste("Table", i, sep="") eval(parse(text=disp)) } ## but this produces no output. Any

[R] stableFit

2009-09-17 Thread tzygmund mcfarlane
A quick question about stableFit() in the fBasics package. Is it possible to constrain the gamma and delta parameters and only estimate the alpha and beta parameters? I tried: ## set.seed(1953) r = rstable(n = 1000, alpha = 1.9, beta = 0.3) stableFit(r, gamma=1, delta=0, type=c("q"

[R] Anderson-Darling (one sample)

2009-08-29 Thread tzygmund mcfarlane
Hi, I would like to compute a goodness-of-fit statistic for one data series against a t-distribution, and obtain the quantiles of the distribution of the statistic with given degrees of freedom. I wonder if this is implemented in a package. I know that the critical values have to be computed for

Re: [R] R formula

2009-08-18 Thread tzygmund mcfarlane
You got the order of the arguments wrong: ## library(systemfit) eqDemand <- consump ~ price + income eqSupply <- consump ~ price + farmPrice + trend fitsur <- systemfit(list(demand=eqDemand, supply=eqSupply), "SUR", data=Kmenta) summary(fitsur) ##

[R] Whittle estimation for ARMA models

2009-08-13 Thread tzygmund mcfarlane
Hi, Does anyone know of a package/script that will implement the Whittle (1953) estimator for the parameters of an invertible stationary ARMA time series model? The estimator is defined on, for example, pg. 378 of Brockwell & Davis (1991). I assume that the internal call .whittle in this code due

[R] Dantzig Selector

2009-07-08 Thread tzygmund mcfarlane
Hi, I was wondering if there was an R package or routines for the Dantzig Selector (Candes & Tao, 2007). I know Emmanuel Candes has Matlab routines to do this but I was wondering if someone had ported those to R. Thanks, T ---Reference--- @article{candes2007dantzig, title={{The Dantzig selec