Re: [R] dataframe to a timeseries object

2011-03-14 Thread Daniele Amberti
sDaply2(X, X$ID) # list is not a timeSeries object str(cbind(t(res))) res <- as.timeSeries(cbind(t(res))) -Original Message- From: h.wick...@gmail.com [mailto:h.wick...@gmail.com] On Behalf Of Hadley Wickham Sent: 14 March 2011 15:07 To: Daniele Amberti Cc: r-help@r-project.org Subjec

Re: [R] dataframe to a timeseries object

2011-03-14 Thread Daniele Amberti
Thanks Hadley for Your interest, below some code without environments use (using timeSeries); I also made some experiments with .parallel = TRUE in daply to crate timeSeries objects and then bind them together but I have some problems. Thank You in advance, Daniele Amberti set.seed(123) N

Re: [R] dataframe to a timeseries object

2011-03-14 Thread Daniele Amberti
, Daniele Amberti set.seed(123) N <- 1 X <- data.frame( ID = c(rep(1,N), rep(2,N,), rep(3,N), rep(4,N)), DATE = as.character(rep(as.POSIXct("2000-01-01", tz = "GMT")+ 0:(N-1), 4)), VALUE = runif(N*4), stringsAsFactors = FALSE) X <- X[sample(1:(N*4), N*4)

[R] dataframe to a timeseries object

2011-03-11 Thread Daniele Amberti
return(get("xx", e1)) } Time02 <- replicate(100, system.time(fooBy(X, X$ID, buildTimeSeriesFromDataFrame, simplify = TRUE))[[1]]) median(Time02) hist(Time02) plot(density(Time02), xlim = c(min(c(Tim

[R] How to save a model in DB and retrieve It

2010-04-02 Thread Daniele Amberti
I'm wondering how to save an object (models like lm, loess, etc) in a DB to retrieve and use it afterwards, an example: wind_ms <- abs(rnorm(24*30)*4+8) air_kgm3 <- rnorm(24*30, 0.1)*0.1 + 1.1 wind_dg <- rnorm(24*30) * 360/7 ms <- c(0:25) kw_mm92 <- c(0,0,0,20,94,205,391,645,979,1375,1795,2000,20

Re: [R] Optimise huge data.frame construction - [ ] Message is from an unknown sender

2010-02-24 Thread Daniele Amberti
Message- From: Moshe Olshansky [mailto:m_olshan...@yahoo.com] Sent: 24 February 2010 11:09 To: r-help@r-project.org; Daniele Amberti Subject: Re: [R] Optimise huge data.frame construction - [ ] Message is from an unknown sender Hi Daniele, One possibility would be to make two runs. In the first

[R] Optimise huge data.frame construction

2010-02-24 Thread Daniele Amberti
I have data for different items (ID) in a database. For each ID I have to get: - Timestamp of the observation (timestamp); - numerical value (val) that will be my response variable in some kind of model; - a variable number of variables in a know set (if value for a

Re: [R] Compress (gzip) a pdf device - [ ] Message is from an unknown sender

2009-10-01 Thread Daniele Amberti
Zahn [mailto:istaz...@gmail.com] Sent: 01 October 2009 17:11 To: Daniele Amberti Cc: r-help@r-project.org; Rainer M Krug Subject: Re: [R] Compress (gzip) a pdf device - [ ] Message is from an unknown sender I guess I don't understand what your're trying to do. gzip-ing a file from within R is ea

Re: [R] Compress (gzip) a pdf device - [ ] Message is from an unknown sender

2009-10-01 Thread Daniele Amberti
(without using an external executable). Daniele From: Rainer M Krug [mailto:r.m.k...@gmail.com] Sent: 30 September 2009 10:26 To: Daniele Amberti Cc: r-help@r-project.org Subject: Re: [R] Compress (gzip) a pdf device - [ ] Message is from an unknown sender 2009/9/30 Daniele Amberti mailto:dan

[R] Compress (gzip) a pdf device

2009-09-30 Thread Daniele Amberti
I have not found an easy way to compress a file on filesystem. Especially I'd like to compress a pdf from pdf() function/device. Is it possible to compress It on the flight? I'd like to do something like: pdf(gzipconnection()) dev.off() If It is not possible, how can I create a gzip with the pdf?

[R] Efficient coding

2009-08-04 Thread Daniele Amberti
I have a piece of code as the one at the bottom, unfortunately since it involves time series from a db it's not easy to give to mailing list a working script. It becomes very slow after few hundred iterations over variable sp (must process several thousands). The Rprof() indicates that the probl

[R] Bayes newby

2009-05-12 Thread Daniele Amberti
* * * I have to setup a simple classification method (mix of factor and numeric variables) that can iteratively: -  Use expert opinion prior on item X1 -  Classify X1 based on estimated model (training set) and expert opinion (previous requirement) -   

[R] R an .net

2009-03-12 Thread Daniele Amberti
Does anyone knows about the possibility to use Microsoft .net runtime (or mono) from R (like RJava for Java)? Thanks in advance Daniele ORS Srl Via Agostino Morando 1/3 12060 Roddi (Cn) - Italy Tel. +39 0173 620211 Fax. +39 0173 620299 / +39 0173 433111 Web Site

Re: [R] ARIMA, AR, STEP - [ ] Message is from an unknown sender

2008-05-08 Thread Daniele Amberti
ict method. Library forecasting seems to do something this way but documentation is not so exhaustive. Thanks -Original Message- From: Prof Brian Ripley [mailto:[EMAIL PROTECTED] Sent: giovedì 8 maggio 2008 14.48 To: Daniele Amberti Cc: r-help@r-project.org Subject: Re: [R] ARIMA

[R] ARIMA, AR, STEP

2008-05-08 Thread Daniele Amberti
Here is my problem: Autoregressive models are very interesting in forecasting consumptions (eg water, gas etc). Generally time series of this type have a long history with relatively simple patterns and can be useful to add external regressors for calendar events (holydays, vacations etc). ari

[R] Date time, MSSQL and RODBC

2008-01-31 Thread Daniele Amberti
Hi, I have to connect to MSSQL server to get some TimeSeries value (datetime, float) on output. Datetime data type in R is a POSIXct date with information about timezone, daylight or solar time. In the DB I have not this kind of information and this cause some problem at the change of time for e