[R] [R-pkgs] mgcViz: scalable ggplot2 visualisations for mgcv

2019-01-28 Thread Matteo Fasiolo
n the underlying methods see: https://arxiv.org/abs/1809.10632 The package is also available on github: https://github.com/mfasiolo/mgcViz so feel free to send comments, criticisms and feature requests via Github issues. Matteo Fasiolo [[alternative HTML version de

[R] [R-pkgs] qgam

2017-09-13 Thread Matteo Fasiolo
://github.com/mfasiolo/qgam Best, Matteo Fasiolo [[alternative HTML version deleted]] ___ R-packages mailing list r-packa...@r-project.org https://stat.ethz.ch/mailman/listinfo/r-packages __ R-help@r

Re: [R] Getting the index of specific quantiles

2016-11-22 Thread Matteo Richiardi
Thanks Sarah (and all the others who replied) for your precious suggestions! Matteo On 22 November 2016 at 14:18, Sarah Goslee wrote: > Here's how to get one: > > x <- c(9,9,1,3,2,7,6,10,5,6) >> which.min(abs(x - quantile(x, .25))) > [1] 4 > > And here's one

[R] Getting the index of specific quantiles

2016-11-22 Thread Matteo Richiardi
what matters - in case the quantile is exactly half way through). This is an example. > x <- c(9,9,1,3,2,7,6,10,5,6) > quantile(x) 0% 25% 50% 75% 100% 1.0 3.5 6.0 8.5 10.0 What I need is a vector 'index' which looks like > index 3 4 7 1 8 Many thanks

[R] Dynamically populate a vector by iteratively applying a function to its previous element.

2016-05-27 Thread Matteo Richiardi
d.] The trick works only for v[2]. I imagine this is because the vector is not dynamically updated during the iteration, so all values v[2:10] are retained as NA. How can I solve the problem, without using a 'for' cycle? Thanks for your help ! Matteo ___

[R] updating elements of a list of matrixes without 'for' cycles

2016-01-29 Thread Matteo Richiardi
nction foo = function(i,j,h){ mycube[i,j,h] <<- i*j*h } # update for(h in 1:H){ # males: for(i in 1:I) for(j in 1:J) foo(i,j,h) } Thanks a lot for your help. Matteo __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more,

Re: [R] creating cubes

2016-01-15 Thread Matteo Richiardi
Hi Daniel, thanks for your answer. How can I populate the array with the matrixes? Suppose I want to populate it with 10 matrixes matrix(NA,5,5) Matteo On 15 January 2016 at 22:26, Dalthorp, Daniel wrote: > How about: D<-array(dim=c(d1, d2, d3))? > > > > On Fri, Jan 1

[R] creating cubes

2016-01-15 Thread Matteo Richiardi
but then D[i] returns a number, and not a matrix. I imagine this is a dummy question, but I did search for an answer on various R help sites, and found nothing straightforward. Being an inexperienced R user, I prefer a simple solution, even at some efficiency cost. Many thanks for your help. Mat

Re: [R] assigning values to elements of matrixes

2015-12-24 Thread Matteo Richiardi
ot;")) > M[i,j] = value > assign(paste("M_",s,sep=""),M, envir = .GlobalEnv) > } > > foo2("a",1,2,15) > > cheers > Peter > > > On 23 Dec 2015, at 09:44, Matteo Richiardi > wrote: > > > > I am following the ex

[R] assigning values to elements of matrixes

2015-12-23 Thread Matteo Richiardi
"),value, envir = .GlobalEnv) } but this produces the problem I described above (namely, a new variable is created, rather than replacing the specified element of the matrix). I know that in this example I could simply pass the matrix as an argument to the function, but I

Re: [R] Applying a function to a matrix using indexes as arguments

2015-12-17 Thread Matteo Richiardi
Hi David, that's a great answer, thanks so much. I imagined apply() was involved in the solution, but I was unable to find how myself. Thanks again. Matteo On 17 December 2015 at 01:37, David Winsemius wrote: > > > On Dec 16, 2015, at 5:34 PM, David Winsemius > wrote: >

Re: [R] Applying a function to a matrix using indexes as arguments

2015-12-16 Thread Matteo Richiardi
; > On December 16, 2015 4:18:56 PM PST, Matteo Richiardi < > matteo.richia...@gmail.com> wrote: > >> I have to evolve each element of a matrix W >> >> W <- matrix(0,2,3) >> >> according to some function which uses the indices of the matrix [i,j] as >&g

[R] Applying a function to a matrix using indexes as arguments

2015-12-16 Thread Matteo Richiardi
How can I do it, without recurring to a loop? Also, in my application I need to pass the function another argument. Thanks a lot for your suggestions. Matteo [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCR

Re: [R] Create a data.table by looping over variable names

2015-12-16 Thread Matteo Richiardi
Hi, thanks a lot to everybody for your help. Very nice suggestions! Matteo On 16 December 2015 at 12:53, Matteo Richiardi wrote: > I apologise for this very basic question, but I found no answers on the > web. > I want to create a data.table with n columns, named i1 ... i'n

[R] Create a data.table by looping over variable names

2015-12-16 Thread Matteo Richiardi
I apologise for this very basic question, but I found no answers on the web. I want to create a data.table with n columns, named i1 ... i'n', with only one row with value = 100 for every variable. I can do it "by hand": M.dt <- data.table(i1=100,i2=100,i3=100) but I would like to make it in a lo

[R] denstrip package: densregion when density is not provided

2015-10-04 Thread Matteo Richiardi
33708 0.5612197 0.6882252 0.8183746 0.7687452 This is the error I get: Error in rank(x, ties.method = "min", na.last = "keep") : unimplemented type 'list' in 'greater' Matteo On 3 October 2015 at 09:16, Matteo Richiardi wrote: > I have several est

[R] denstrip package: densregion when density is not provided

2015-10-03 Thread Matteo Richiardi
I have several estimated time series, running from 2013 to 2050. 'y' values are constrained between 0 and 1. I would like to plot them using shaded colours of decreasing intensity, depending on an estimated density at each point x in 2013-2050. This is what I have done: require(denstrip) x <- 201

[R] how to call rbind using arguments from a list

2015-06-17 Thread Matteo
Hello R users, I am trying to run the command rbind gathering the name of tables to bind from a list argument. Unfortunately I am not able to obtain it. I would appreciate any suggestions. Below is a reproducible example with the problem. Thanks Matteo

[R] Error in ginv(A) : 'X' must be a numeric or complex matrix

2015-06-14 Thread Matteo Villa
5d7893bf And here is the code (the error occurs after executing the final line, which is also a toy model to be estimated through the bsar function): https://gist.github.com/lessermatter/0284be117a19620750aa Any ideas? Kind regards, Matteo Villa Università de

[R] Error in ginv(A) : 'X' must be a numeric or complex matrix

2015-06-13 Thread Matteo Villa
ine, which is also a toy model to be estimated through the bsar function): https://gist.github.com/lessermatter/0284be117a19620750aa Any ideas? Kind regards, Matteo Villa Università degli Studi di Milano Italy [[alternative HTML version deleted]] ___

Re: [R] Put 2 ablines in an "empty plot"

2014-12-05 Thread Matteo Murenu
plot.new() abline(0,1) abline(1,1) # or as Michael suggest plot(1:10, 1:10, type = "n") # then abline(0,1) abline(1,1) Best Matteo Murenu, Cagliari, IT -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of David Winsemius Sent: 05 December 201

[R] speed issue in simulating a stochastic process

2014-11-06 Thread Matteo Richiardi
but still clear and readable alternative? Thanks a lot. Matteo rm(list=ls()) library(plyr) y0 = 0 lambda = 0.1 N = 20 T = 100 m_e = 0 sd_e = 1 # construct the data frame and initialize y D = data.frame( id = rep(1:N,T), t = rep(1:T, each = N), y = rep(y0,N*T) ) # update y for(t in 2:T

[R] nlrq-{quantreg}

2014-03-18 Thread Francesco Di Matteo
Dear all, I am trying to use the nonlinear quantile regression which involves copula functions. Following the Frank copula example provided in the "quantreg" vignette I try do do the same using the Normal (Gaussian) copula. The problem is that the "nlrq" algorithm stops by giving the following err

[R] ODE does not reach steady state and increase exponentially

2013-11-28 Thread Matteo Charlie Ichino
of different size classes, depending on the amount of available food. Nevertheless the biomass does not reach steady state, and increases exponentially even with parameters set to 0 (which in theory should result in a biomass value of 0) Thank you very much for your help! I appreciate it Matteo

Re: [R] extracting submatrix from a bigger one

2013-06-24 Thread matteo
11 x3138 Sorry if I'm not able to explain it better and as I said I'm very new to R. Thanks Matteo __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting gui

Re: [R] extracting submatrix from a bigger one

2013-06-24 Thread matteo
Hi, result <- lapply(unique(dataset$ID), function(uid) dataset[dataset$ID == uid, ]) Ok, I have the element result as a list names(result) <- unique(dataset$ID) Nothing happens. I don't have any submatrix... Matteo __ R-help@r-

[R] extracting submatrix from a bigger one

2013-06-24 Thread matteo
every point of sampling. I can do it manually, e.g. x1<-data.frame(dataset[dataset$ID=="x1",]) but is it possible to write a script and let do it to R? So i got n submatrix of the n ID found in the original columns. Cheers Matteo __ R-

[R] statda package issue

2013-06-23 Thread matteo
I all, I'm new on this list, so sorry if I do something wrong. Anyway, I have a problem with the installation of the package StatDA. Typing install.package("StatDA") I receive the error: ERROR: configuration failed for package ‘MBA’ * removing ‘/home/matteo/R/i686-pc-linux-gnu-

[R] plot Predicted survival probabilitie

2013-06-08 Thread matteo pettinari
c('mean')) Error in Getlimi(name[i], Limval, need.all = TRUE) : no limits defined by datadist for variable Age -- can someone give me any advice about this problem and to create nice plot with x axis a continuous predictor and y axis the predicted survival? Thank you Dr. Matteo Pettin

[R] Antw: [R-sig-Geo] RCurl: using ls instead of NLST

2013-05-29 Thread Matteo Mattiuzzi
I also had a lot of problems with the ftplistonly=T option so I decided to use the saver version FALSE and split it by my own. Matteo MODIS:::filesUrl filesUrl <- function(url) { require(RCurl) if (substr(url,nchar(url),nchar(url))!="/") { url <- paste0(u

Re: [R] lazy loading like object

2013-05-28 Thread Matteo Mattiuzzi
bject is load()-ed on every need. That should be fairly fast as the object itself is very small and it is not needed to often. Thanks Matteo On 28/05/2013 08:20, Matteo Mattiuzzi wrote: > Dear List, > > > I'm writing the package MODIS (currently on R-forge), I lazy load s

[R] lazy loading like object

2013-05-28 Thread Matteo Mattiuzzi
rnal library gdal-bin. So it takes only _once_ the time to produce that object that is from now on available for any other function in the package environment. I hope I was clear, thanks in advanced, Matteo Mattiuzzi __ R-help@r-proje

Re: [R] Sum up column values according to row id

2013-04-26 Thread Matteo Mura
77840-4352 > > > > > > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On > Behalf Of Matteo Mura > Sent: Wednesday, April 24, 2013 7:57 AM > To: r-help@r-project.org > Subject: [R] Sum up column values acc

[R] Sum up column values according to row id

2013-04-24 Thread Matteo Mura
are already ordered by id ascending and g descending using: ipso <- ipso[with(ipso, order(ipso$id, -ipso$g)), ] # Order for id ascending and g descending I tried a lot of for loops and tapply() without results. Can anyone help me to solve this? Thanks for your attention Best whishes

[R] How can I eliminate a loop over a data.table?

2013-03-19 Thread Matteo Richiardi
.DT 0.34447791 is the fifth value in B.DT, and it is left unassigned because it is too big. This is of course a simplified problem (and therefore may not make much sense). Thanks for your time and input. Matteo [[alternative HTML version deleted]]

[R] How can I eliminate a loop over a data.table?

2013-03-18 Thread Matteo Richiardi
.DT 0.34447791 is the fifth value in B.DT, and it is left unassigned because it is too big. This is of course a simplified problem (and therefore may not make much sense). Thanks for your time and input. Matteo __ R-help@r-project.org mailing list https

Re: [R] plm random effect: the estimated variance of the individual effect is negative

2013-01-04 Thread matteo ognibene
or: > Error in if (sigma2$id < 0) stop(paste("the estimated variance of the",  :  >             missing value where TRUE/FALSE needed Thanks Matteo Ognibene > Subject: Re: [R] plm random effect: the estimated variance of the individ

Re: [R] plm random effect: the estimated variance of the individual effect is negative

2013-01-04 Thread matteo ognibene
the same random effect model in Stata and it works... (and for the within model the results are identical in R and Stata) I'll be really gratefull if someone can help me. Thanks, Matteo > CC: r-help@r-project.org > From: dwinsem...@comcast.net > To: ognibenemat...@hotmail.it >

[R] plm random effect: the estimated variance of the individual effect is negative

2013-01-03 Thread matteo ognibene
")) I want to point the all the code works perfectly in a within model, and I tried using all the random.method for the variance estimation.In addition I used the same model in Stata and it works... (the results are identical for a within mo

[R] I need intercept in plm model

2012-12-29 Thread matteo ognibene
), model="within") my output: Coefficients : Estimate Std. Error t-value Pr(>|t|) L1.deltaS -0.063576 0.017950 -3.5419 0.0004031 ***L2.deltaS -0.068272 0.017966 -3.8001 0.0001474 ***--- I tried adding "-0", "+1", "intercept=TRUE" Thanks

[R] listening folder and directories on ftp server

2012-03-07 Thread Matteo Mattiuzzi
ften happens that I get a errorcode 550 an I'm not able to get the information. If I put the very same adress to a browser I get te content, so the connection is working. Thanks in advance Matteo library(RCurl) filelisturl <- "ftp://e4ftl01.cr.usgs.gov/MOLT/MOD13Q1.005/200

Re: [R] plotting regression line in with lattice

2012-01-14 Thread matteo dossena
t; > On Fri, Jan 13, 2012 at 11:30 AM, matteo dossena wrote: >> #Dear All, >> #I'm having a bit of a trouble here, please help me... >> #I have this data >> set.seed(4) >> mydata <- data.frame(var = rnorm(100), >>

[R] plotting regression line in with lattice

2012-01-13 Thread matteo dossena
}, key = list(space = "right", text = list(c("trt1", "trt2"), cex = 0.8), points = list(pch = c(21), fill = c("black", "grey")), rep = FALSE)

Re: [R] labels in lattice

2011-12-14 Thread matteo dossena
Thanks David and Patrick, really appreciate tour help... m. Il giorno 14 Dec 2011, alle ore 18:33, David Winsemius ha scritto: > > On Dec 14, 2011, at 11:43 AM, matteo wrote: > >> set.seed(3) >> mydata <- data.frame(var = rnorm(100,20,1), >>

[R] labels in lattice

2011-12-14 Thread matteo
nd so on. Any suggestions... Many thanks matteo -- View this message in context: http://r.789695.n4.nabble.com/labels-in-lattice-tp4195766p4195766.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing li

[R] using StatEt IDE for Eclipse

2011-12-06 Thread Matteo Richiardi
Hi, I'm trying to use StatEt IDE for Eclipse as my R editor, but I'm completely lost. I've read all I could find online, made apparently all I had to do (installing rj, configuraing StatEt, etc.) but still cannot make R running. Below is the error log file. Thank you so much for ass

[R] using StatEt IDE for Eclipse

2011-12-05 Thread Matteo Richiardi
Hi, I'm trying to use StatEt IDE for Eclipse as my R editor, but I'm completely lost. I've read all I could find online, made apparently all I had to do (installing rj, configuraing StatEt, etc.) but still cannot make R running. Below is the error log file. Thank you so much for ass

[R] efficient ways to dynamically grow a dataframe

2011-12-01 Thread Matteo Richiardi
I don't want to go for a matrix, because I'd loose the column names and everything will become too much error-prone. Any suggestions on how to do it? Thanks in advance, Matteo -- Matteo Richiardi University of Turin Faculty of Law Department of Economics "Cognetti De Mart

[R] detecting autocorrelation structure in panel data

2011-11-27 Thread Matteo Richiardi
ata.frame in a ts or a xts object, but got really lost there. I'd really apreciate help... Thank you, Matteo __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project

Re: [R] [R-sig-ME] account for temporal correlation

2011-11-18 Thread matteo dossena
Thanks again, really appreciate that. Il giorno 18 Nov 2011, alle ore 23:06, Ben Bolker ha scritto: > [cc'ing back to r-help] > > On Fri, Nov 18, 2011 at 4:39 PM, matteo dossena > wrote: >> Thanks a lot, >> >> just to make sure i got it right, >>

Re: [R] R-bash beginner

2011-11-08 Thread Matteo Giani
write a 'fully functional' script, though, because of quoting troubles and so on. best regards, -- Matteo Giani __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://

[R] problem with ROCR

2011-02-28 Thread Matteo Pettinari
Dear R team I have a problem with the installation of the RCOR package; any time I try to install it I get the error message: Error: package 'ROCR' was built before R 2.10.0: please re-install it. What can I do to solve this problem? Thank you Kind regards Dr. Matteo Pettin

[R] Arima online forecasting

2010-04-22 Thread Matteo Bertini
model) cat(forecast(air.model2, h=2)$mean, '\n') } But this approach, even if not fitting the model from scratch, is still very slow for big timeseries. Some hints to speed it up? Thanks, Matteo [[alternative HTML version deleted]] __

Re: [R] Arima forecasting

2010-03-22 Thread Matteo Bertini
> Matteo Bertini schrieb: >> >> Hello everyone, >> >> I'm doing some benchmark comparing Arima [1] and SVR on time series data. >> >> I'm using an out-of-sample one-step-ahead prediction from Arima using >> the "fitted" method

[R] Arima forecasting

2010-03-19 Thread Matteo Bertini
Hello everyone, I'm doing some benchmark comparing Arima [1] and SVR on time series data. I'm using an out-of-sample one-step-ahead prediction from Arima using the "fitted" method [2]. Do someone know how to have a two-steps-ahead forecast timeseries from Arima? Thanks

[R] output of "for"

2009-10-29 Thread Matteo Mattiuzzi
er "dates") but after changing, "for" gave no more output. And I don't know why!!! Why i use "for" twice? Because after the last file there is no "|"... Thanks for help Matteo [[alternative HTML version deleted]] _

[R] colMeans()

2009-09-28 Thread Matteo Mattiuzzi
e it takes is multiplied by this factor! (so getting this with "rowSums(is.na(x))" it takes much to long) I was trying to look inside the function maybe to get not only the means but the valid "n" too, but I wasn't able. Thanks for help Matteo DI Matteo Mattiuzzi, Inst

[R] fit arima long period alternatives

2009-09-10 Thread Matteo Bertini
I'd like to fit a SARIMA model on a timeseries but the period I'd like to use is too big (7 day in 15min samples = 672) for the algorithm used in R. Some suggested alternatives? Thanks, Matteo Bertini [[alternative HTML version deleted]] __

[R] Is arima forecast

2009-07-21 Thread Matteo Bertini
Using the gretl.sf.net dialect: Static forecasts are one step ahead, based on realized values from the previous period, while dynamic forecasts employ the chain rule of forecasting. What kind of forecast is doing forecast.Arima? Thanks, Matteo Bertini