Re: [R] [FORGED] Plotting in LaTeX with ggplot2 in R and using tikzdevice

2016-08-03 Thread Ulrik Stervbo
I saved my plots as pdf and used pdflatex. It's a few years ago and now you can even use the r-package cowplot to create panels with subfigures. That means more work with r, less manual work. I believe kable from the knitr package can export tables for latex too. Hope this helps. Ulrik Paul

Re: [R] [FORGED] Plotting in LaTeX with ggplot2 in R and using tikzdevice

2016-08-03 Thread Paul Murrell
Hi You might need an approach that converts the ggplot object to a gtable and then either combine the gtables as here ... http://stackoverflow.com/questions/16255579/how-can-i-make-consistent-width-plots-in-ggplot-with-legends ... or explicitly control the width of the plot within the gtable

[R] foreach {parallel} nested with for loop to update data.frame column

2016-08-03 Thread Alexander.Herr
Hi List, Trying to update a data.frame column within a foreach nested for loop ### trial data set.seed(666) xyz<-as.data.frame(cbind(x=rep(rpois(5000,10),2)+1, y=rep(rpois(5000,10),2)+1,z=round(runif(1, min=-3, max=40),2))) xyz$mins<-rep(NA, nrow(xyz)) cl<-makeCluster(16) #adjust to your

Re: [R] Plotting in LaTeX with ggplot2 in R and using tikzdevice

2016-08-03 Thread Jeff Newmiller
I would think knitr package would be useful in this endeavor. And possibly RStudio If that doesn't do it, someone here may have a better hint, but solving this kind of question can require studying both the input (R code) and output (tikz/LaTeX code). While the R code belongs here,

Re: [R] Martingale residuals warning

2016-08-03 Thread David Winsemius
> On Aug 3, 2016, at 12:07 PM, Isaac Singini via R-help > wrote: > > Dear AllI am new to R, I am struggling to figure out and resolve warning.I > have fitted a joint model for survival and longitudinal data using the "JM" > library using the syntax below. > #

[R] Plotting in LaTeX with ggplot2 in R and using tikzdevice

2016-08-03 Thread Ecstasia Tisiphoni
Hello, not totally sure if this is a R or a LaTeX topic... I am a total newbie to R and LaTeX, and trying to write my masters thesis right now... I tried to get this answered via https://cran.r-project.org/web/packages/tikzDevice/vignettes/tikzDevice.pdf ...but I failed... :( I am creating

[R] Martingale residuals warning

2016-08-03 Thread Isaac Singini via R-help
Dear AllI am new to R,  I am struggling to figure out and resolve warning.I have fitted a joint model for survival and longitudinal data using the "JM" library using the syntax below. # Longitudinal submodellmeFit.p1_constr <- lme(sqrtcd4wk ~ cd4tpt  + pred:cd4tpt, data = cd4long_constr,       

[R] Effect of an optimized BLAS library on lm() function

2016-08-03 Thread Stéphane Tufféry
Dear All, My question is simple (but the answer perhaps less): how does R lm() function benefit from an optimized BLAS library (such as ATLAS, OpenBLAS, or the MKL library in R Open)? I suppose that these BLAS optimizations concentrate on the level-3 BLAS, and lm() function relies on level-1

[R] Odds ratios in logistic regression models with interaction

2016-08-03 Thread Laviolette, Michael
I'm trying to reproduce some results from Hosmer & Lemeshow's "Applied Logistic Regression" second edition, pp. 74-79. The objective is to estimate odds ratios for low weight births with interaction between mother's age and weight (dichotomized at 110 lb.). I can get the point estimates, but I

Re: [R] plot many dfs in ggplot (and other ggplot questions)

2016-08-03 Thread Zach Simpson
Hi, In regards to your first question: >Hi R users, >I have a dataframe, with daily precipitation data, is it possible to plot >annual mean or annual sum values directly? Thanks for your help. >df >year month day precip time >2010 1 10.5 2010-01-01 >2010

Re: [R] It is possible to use "input parameters" with "standard error" in fitting function nls

2016-08-03 Thread Bert Gunter
Unless there is good reason to do otherwise, you should cc the list to allow others to provide perhaps better responses or to correct my possible errors. I have done so here. If your "parameter" is fixed in the modeling it cannot contribute to the uncertainty of estimation of the remaining model

Re: [R-es] ¿Qué hace as.numeric()?

2016-08-03 Thread javier.ruben.marcuzzi
Estimado Mauricio Monsalvo Usted dice que el csv es muy pesado y sucio, por lo cuál es posible que su trabajo en R sea correcto, pero como los datos son “malos en su calidad de almacenamiento”, hay problemas. CSV es leído por planillas de cálculo y bases de datos, las primeras son fáciles

[R-es] ¿Qué hace as.numeric()?

2016-08-03 Thread Mauricio Monsalvo
Hola. Mi problema del día... Estoy importando un .csv muy pesado y muy sucio, en el sentido de tener variables con problemas en sus datos. En concreto lo que me pasa es que logro levantarlo, tal que para un caso concreto del data.table obtengo un valor: 753,2256 que parece un número pero es un

Re: [R] plot many dfs in ggplot

2016-08-03 Thread Ulrik Stervbo
That Petr already showed. Please read his email again. lily li schrieb am Mi., 3. Aug. 2016 21:09: > Thanks. How to add an additional column, with the name of each dataframe's > name? > > On Wed, Aug 3, 2016 at 1:06 PM, Ulrik Stervbo > wrote: > >>

Re: [R] plot many dfs in ggplot

2016-08-03 Thread lily li
Thanks. How to add an additional column, with the name of each dataframe's name? On Wed, Aug 3, 2016 at 1:06 PM, Ulrik Stervbo wrote: > Not quite - this works: rbind(df1, df2, df3, df1, df2, df3) > > Or if the have your data.frames in a list, use do.call: > > df.lst <-

Re: [R] plot many dfs in ggplot

2016-08-03 Thread Ulrik Stervbo
Not quite - this works: rbind(df1, df2, df3, df1, df2, df3) Or if the have your data.frames in a list, use do.call: df.lst <- list(df1, df2, df3, df1, df2, df3) do.call(rbind, df.lst) You might take a look at the facet functionality in ggplot once you are ready to build your plots. Best, Ulrik

Re: [R] how to plot annual values directly

2016-08-03 Thread Ulrik Stervbo
You could use dplyr: library(plyr) ddply(df, .variables = "year", summarise, mean.precip = mean(precip)) Hope this helps Ulrik On Wed, 3 Aug 2016 at 17:29 lily li wrote: > I meant that my dataframe has daily data, but how to plot annual mean/sum > directly? Thanks. > >

Re: [R-es] cambiar nombres a una matriz

2016-08-03 Thread javier.ruben.marcuzzi
Estimado Luis Espíndola Entiendo que usted no tiene una matriz, sino un data.frame. Yo no uso esa función, pero es posible por ejemplo: x <- data.frame(a = c(0,1,2,NA), b = c(0,NA,1,2), c = c(NA, 0, 1, 2)) x x$a <- replace(x$a, is.na(x$a), 0) x x$b <- replace(x$b, x$b==2, 333) Yo realizo una

Re: [R] It is possible to use "input parameters" with "standard error" in fitting function nls

2016-08-03 Thread Bert Gunter
Vicente: You have not received a reply. I think it is because your post appears to reveal a profound lack of understanding about how empirical modeling works: the uncertainty in parameter estimates derives from the uncertainty in the data (via the modeling process, of course). You cannot set them

Re: [R-es] Función timeVariation openair

2016-08-03 Thread Carlos Ortega
Hola, Lo que estás comentando es la aplicación de un t-test para las dos muestras (tus dos series temporales) y con este test determinar si son las medias iguales o no. Pero con las series temporales, no puedes aplicar un t-test porque en las series temporales los valores están auto-correlados

Re: [R] plot many dfs in ggplot

2016-08-03 Thread lily li
Thanks, but rbind/merge function only combines two dataframes each time, how to work on multiple dataframes? Thanks again. On Wed, Aug 3, 2016 at 4:20 AM, PIKAL Petr wrote: > Hi. > > Hm. I would add a column indicating data frame and merge/rbind all data > frames. > >

Re: [R] how to plot annual values directly

2016-08-03 Thread lily li
I meant that my dataframe has daily data, but how to plot annual mean/sum directly? Thanks. On Wed, Aug 3, 2016 at 4:16 AM, PIKAL Petr wrote: > Hi > > What do you mean to plot annual mean/sum directly? You can compute it by > aggregate function and add it to your plot,

Re: [R] Three way correspondence analyses?

2016-08-03 Thread David L Carlson
There are at least two canonical correspondence analysis functions named cca() in different R packages so we don't have enough information to begin. The posting guide encourages providing a reproducible example using dput() to provide enough data so that we can run your code. If we don't know

[R] Predicted values VS residuals

2016-08-03 Thread greg holly
Dear all; I am sorry for my earlier post without subject. My question in earlier mail was: I am going to run models for variable selection using elastic-net. Because I have about 1500 descriptive (independent) variables which they are highly correlated. Before running elastic-net and even single

[R] (no subject)

2016-08-03 Thread greg holly
Hi all; I am going to run models for variable selection using elastic-net. Because I have about 1500 descriptive (independent) variables which they are highly correlated. Before running elastic-net and even single regressions (~1500) I need get fitted values for dependent variables using MIXED

Re: [R] p.adjust not working correctly?

2016-08-03 Thread David L Carlson
Part of the confusion is that Bonferroni is often described as an adjustment to the significance level (sig-level) not the p-value. For example, to evaluate p-values when there are 8 tests, we compare the p-value to the sig-level/8 so the sig-level decreases. The p.adjust() function adjusts the

Re: [R] Multiple plot in a page

2016-08-03 Thread roslinazairimah zakaria
Hi Duncan and Jim, Yes, definitely you are right. I should comment the third par(). par(mfrow=c(1,2)) stn_all<-matrix(400*rnorm(20)+4,ncol=2) par(mar=c(4,4,2,1.2),oma = c(1, 1, 1, 1),xaxs="i", yaxs="i") hist(stn_all[,1],prob=TRUE, main ="Balok ",col="yellowgreen", cex.axis=1.2, xlab="Rain

Re: [R] Multiple plot in a page

2016-08-03 Thread Duncan Murdoch
On 03/08/2016 8:01 AM, roslinazairimah zakaria wrote: Hi Jim, I tried your code, however it still gives me only one plot. I don't understand what is going on. Any clue? The third par() call tells R that you want to start a new page. (So did the second one, but it wasn't a problem there.)

Re: [R] Multiple plot in a page

2016-08-03 Thread roslinazairimah zakaria
Hi Jim, I tried your code, however it still gives me only one plot. I don't understand what is going on. Any clue? On Wed, Aug 3, 2016 at 4:55 PM, Jim Lemon wrote: > Hi Roslina, > You only specify space for two plots in: > > par(mfrow=c(1,2)) > > However, you only try

[R] It is possible to use "input parameters" with "standard error" in fitting function nls

2016-08-03 Thread Vicente Martí Centelles
Dear all, I would like to introduce an input parameter with an associated standard error to perform a fitting using the nls function (or any similar function): parameter1 = 9.00 +/- 0.20 (parameter 1 has a value of 9.00 and standard error of 0.20) fittingResults <- nls(y ~ function(xdata,

Re: [R] plot many dfs in ggplot

2016-08-03 Thread PIKAL Petr
Hi. Hm. I would add a column indicating data frame and merge/rbind all data frames. Something like df1$fr <- 1 df2$fr <- 2 dfkompl <- rbind(df1, df2) ggplot(dfkompl, aes(x=time, y=varA, colour=factor(fr)) Cheers Petr > -Original Message- > From: R-help

Re: [R] p.adjust not working correctly?

2016-08-03 Thread S Ellison
> p.adjust for bonferroni p value correction does not appear to be working > correctly: You should re-check what a Bonferroni correction does, or at least reboot your intuition (mine needs rebooting all the time). All the p-values should _increase_ by a factor of n, with a ceiling of 1.0.

Re: [R] how to plot annual values directly

2016-08-03 Thread PIKAL Petr
Hi What do you mean to plot annual mean/sum directly? You can compute it by aggregate function and add it to your plot, but I am not sure if it is enough direct. Cheers Petr > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of lily li > Sent: Tuesday,

[R] [R-pkgs] new version of package water: Actual Evapotranspiration with Energy Balance Models

2016-08-03 Thread Guillermo Federico Olmedo
Dear R users, I'm glad to announce the new version of water package (0.5). As this is my first message to the list, I want to add that this package provides tools to estimate actual evapotranspiration from surface energy balance models. Right now you can run the well-know METRIC model using it.

[R] p.adjust not working correctly?

2016-08-03 Thread Alicia Ellis
p.adjust for bonferroni p value correction does not appear to be working correctly: > p <- runif(50) > > p [1] 0.08280254 0.08955706 0.19754389 0.52812033 0.68907772 0.21849696 0.02774784 0.23923562 0.03482480 0.76437481 0.87236155 0.76438604 [13] 0.37432032 0.89630318 0.01626565 0.08152060

Re: [R] Multiple plot in a page

2016-08-03 Thread Michael Dewey
Dear Rosalina I do not think par(mfrow(c(1, 2)) does what you think it does although mfrow(c(2, 2)) might. You could consider using layout() instead On 03/08/2016 06:44, roslinazairimah zakaria wrote: Dear r-users, I would like to plot 4 graphs arranged as 2 by 2 and follows are my codes.

Re: [R] Multiple plot in a page

2016-08-03 Thread Jim Lemon
Hi Roslina, You only specify space for two plots in: par(mfrow=c(1,2)) However, you only try to plot two plots, so I will assume that you only want two. You haven't defined "x" in the above code, which will cause an error. The code below gives me two plots as I would expect (I made up the data