Re: [R] How to extract convergence code from lmer object?

2014-07-06 Thread Ben Bolker
Juan Andres Hernandez jhernandezcabrera at gmail.com writes: Does anyone know how to extract the convergence code of an lmer object. I am working in a monte carlo simulation with mixed model and I need to know if a model has or not convergence. With unclass(mymodel) the following

Re: [R] Predictions from coxph or cph objects

2014-07-06 Thread Göran Broström
David and Axel, I have two comments to your discussion: (i) The area under the survival curve is equal to the mean of the distribution, so the estimate of the mean should be the sum of the areas of the rectangles defined by the estimated survival curve and the successive distances between

Re: [R] Predictions from coxph or cph objects

2014-07-06 Thread Göran Broström
On 2014-07-06 10:48, Göran Broström wrote: David and Axel, I have two comments to your discussion: (i) The area under the survival curve is equal to the mean of the distribution, so the estimate of the mean should be the sum of the areas of the rectangles defined by the estimated survival

[R] sort order of a character sequence is different on windose and linux (linux result)

2014-07-06 Thread Witold E Wolski
This is the result of sorting a character sequence on a linux box (with R . 3.10) bla = read.table(xx.txt,stringsAsFactors=F) bla = bla[,1] bla[1:10] [1] 1000_DGFVALSK_2_run0 1000_DGFVALSK_2_run0 1000_DGFVALSK_2_run0 1000_DGFVALSK_2_run0 1000_DGFVALSK_2_run0 [6] 1000_DGFVALSK_2_run0

[R] sort order of a character sequence is different on windose and linux (windows result)

2014-07-06 Thread Witold E Wolski
And here is the result when sorting the same sequence on a windows box: bla = read.table(xx.txt,stringsAsFactors=F) bla = bla[,1] bla[1:10] [1] 1000_DGFVALSK_2_run0 1000_DGFVALSK_2_run0 1000_DGFVALSK_2_run0 1000_DGFVALSK_2_run0 [5] 1000_DGFVALSK_2_run0 1000_DGFVALSK_2_run0

Re: [R] sort order of a character sequence is different on windose and linux (linux result)

2014-07-06 Thread Duncan Murdoch
On 06/07/2014, 6:30 AM, Witold E Wolski wrote: This is the result of sorting a character sequence on a linux box (with R . 3.10) See ?sort. The sort order depends on your locale. Set it to C for consistent ordering if that is important to you. For example, on my system: B a [1] FALSE

Re: [R] sort order of a character sequence is different on windose and linux (linux result)

2014-07-06 Thread Witold E Wolski
It seems that the package I am developing depends on the locale C because of interactions with other packages (data.table). So I would like to set the locale to C as soon as the package is loaded. Where can I do it .. I could of course set it in every function in my package but...

Re: [R] sort order of a character sequence is different on windose and linux (linux result)

2014-07-06 Thread Duncan Murdoch
On 06/07/2014, 7:19 AM, Witold E Wolski wrote: It seems that the package I am developing depends on the locale C because of interactions with other packages (data.table). So I would like to set the locale to C as soon as the package is loaded. Where can I do it .. I could of course set it in

Re: [R] sort order of a character sequence is different on windose and linux (linux result)

2014-07-06 Thread Witold E Wolski
This is the info I got from the data.table developers... Seems that they did have tried to find a more elegant solution solution.: data.table used to support this until 1.8.6. But since Scollate became not a part of authorised R-API (IIUC) anymore at some point, data.table only supports

Re: [R] sort order of a character sequence is different on windose and linux (linux result)

2014-07-06 Thread Duncan Murdoch
On 06/07/2014, 7:56 AM, Witold E Wolski wrote: This is the info I got from the data.table developers... Seems that they did have tried to find a more elegant solution solution.: From my reading of the response below, data.table doesn't use R's sort() function to do their sorting. You should

[R] spatstat package: Simulating from fitted Matern cluster process model fails

2014-07-06 Thread Philipp Hunziker
Dear R-help list, I'm using the excellent spatstat package to fit an inhomogeneous Matern cluster point process model, but unfortunately I'm unable to simulate new data points from the fitted object. Specifically, I get the following error message: Error in rthin(result, P) : some points of

Re: [R] Predictions from coxph or cph objects

2014-07-06 Thread Axel Urbiz
many thanks all for this discussion. It was very helpful. Best, Axel. On Sun, Jul 6, 2014 at 5:17 AM, Göran Broström goran.brost...@umu.se wrote: On 2014-07-06 10:48, Göran Broström wrote: David and Axel, I have two comments to your discussion: (i) The area under the survival curve

Re: [R] Using R to analyze multiple MRI studies

2014-07-06 Thread moleps
Yes-I did look through the CRAN view and could not find any package that featured a function whereby an MRI set was transformed into Talairach or MNI space. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

[R] Expanding dataset on the values of one of its variables

2014-07-06 Thread Clive Nicholas
Hello! I have a dataset which is perhaps rather topical at about this time: wc=read.delim(/home/openclive/Documents/worldcup.csv,header=T,sep=\t,fill=T) head(wc,n=20) team year time score out top goals host format formed culture wcups cholder times 1 ARG 19861 6 0 1 4

Re: [R] Predictions from coxph or cph objects

2014-07-06 Thread Frank Harrell
When using cph in the rms package there is a function Mean that operates on cph objects to produce an R function for computing the mean or restricted mean life time. Frank __ R-help@r-project.org mailing list

Re: [R] Expanding dataset on the values of one of its variables

2014-07-06 Thread arun
Hi, Not sure about the expected output. If `dat` is the dataset: res - dat[rep(1:nrow(dat), dat$score),] head(res,7)     team year time score out top goals host format formed culture wcups cholder 1    ARG 1986    1 6   0   1 4    0  0   1893  93 8   0 1.1  ARG 1986    1  

Re: [R] Expanding dataset on the values of one of its variables

2014-07-06 Thread Clive Nicholas
Arun K, Not sure about the expected output. If `dat` is the dataset: res - dat[rep(1:nrow(dat), dat$score),] head(res,7) team year time score out top goals host format formed culture wcups cholder 1ARG 19861 6 0 1 40 0 1893 93 8 0 1.1 ARG

Re: [R] Using subplot (from Hmisc) along with par(mfrow)

2014-07-06 Thread Frank Harrell
Greg I just re-copied the latest subplot and its help file from TeachingDemos to Hmisc for the next release. Thanks for pointing this out. Frank __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

[R] A custom legend for three data frames in one plot

2014-07-06 Thread Artur Rataj
Hello. I have three data frames, and made a single plot out of them. Here is a workable example: cloud2 - data.frame(x = c(0, 1, 2), y = c(0.3, 0.4, 0.5)) sandwich3 - data.frame(x = c(1, 2, 3), y = c(0.4, 0.5, 0.6), p = c(0.1, 0.6, 0.3)) sandwich4 - data.frame(x = c(3, 4, 5), y = c(0.6, 0.3,

[R] package: RWinEdt question

2014-07-06 Thread Mari
I just upgraded WinEdt from 5.2 to 8.2. With the older version, invoking library(RWinEdt) started a new instance of WinEdt identified by R-WinEdt as the title. This way, I was able to separate R work from other editing work with two instances of WinEdt running. However, with the newer version

Re: [R] package: RWinEdt question

2014-07-06 Thread Uwe Ligges
The RWinEdt package does not support WinEdt 8.x yet. Versions 5.x and 6.x shoudl be supported. Not sure about 7.x. Unfortunately, the trick to get it working changes with each version of WinEdt these days ... Well, I may be too bad in WinEdt macro programming... I do notn have the new versions

Re: [R] package: RWinEdt question

2014-07-06 Thread Duncan Murdoch
On 06/07/2014, 4:35 PM, Uwe Ligges wrote: The RWinEdt package does not support WinEdt 8.x yet. Versions 5.x and 6.x shoudl be supported. Not sure about 7.x. Unfortunately, the trick to get it working changes with each version of WinEdt these days ... Well, I may be too bad in WinEdt macro

Re: [R] package: RWinEdt question

2014-07-06 Thread Mari
Thank you for your quick reply. Except for the instances issue, RWinEdt seems to be working well with WinEdt 8.2 so I'll continue to use it. (I can't customize keyboard shortcuts in RStudio or some of the other often mentioned editors). I looked at the code for startWinEdt and I can see where

Re: [R] spatstat package: Simulating from fitted Matern cluster process model fails

2014-07-06 Thread Rolf Turner
There appears to be a small bug in the code. What is happening is that occasionally there are simulated points that lie inside your triangular window but do not lie inside any pixel of the image created from your distorigin() function. This will be fixed in a future release of spatstat.

Re: [R] A custom legend for three data frames in one plot

2014-07-06 Thread Jim Lemon
On Sun, 6 Jul 2014 05:31:34 PM Artur Rataj wrote: Hello. I have three data frames, and made a single plot out of them. Here is a workable example: cloud2 - data.frame(x = c(0, 1, 2), y = c(0.3, 0.4, 0.5)) sandwich3 - data.frame(x = c(1, 2, 3), y = c(0.4, 0.5, 0.6), p = c(0.1, 0.6, 0.3))

[R] Question regarding lattice::levelplot and distribution of colors

2014-07-06 Thread Sunny Srivastava
Hello R-helpers: I think there is some problem with my code, but I would like to seek you help because I can't spot it. I have a data.frame defined as follows: testdf - structure(list(yy = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L), .Label = c(R, L), class =

[R] Box-cox transformation

2014-07-06 Thread Ravi Varadhan
Hi, I am trying to do Box-Cox transformation, but I am not sure how to do it correctly. Here is an example showing what I am trying: # example from MASS require(MASS) boxcox(Days+1 ~ Eth*Sex*Age*Lrn, data = quine, lambda = seq(-0.05, 0.45, len = 20)) # Here is My attempt at getting

Re: [R] Box-cox transformation

2014-07-06 Thread Joshua Wiley
Hi Ravi, Deviance is the SS in this case, but you need a normalizing constant adjusted by the lambda to put them on the same scale. I modified your example below to simplify slightly and use the normalization (see the LL line). Cheers, Josh ##

Re: [R] Question regarding lattice::levelplot and distribution of colors

2014-07-06 Thread David Winsemius
On Jul 6, 2014, at 4:35 PM, Sunny Srivastava wrote: Hello R-helpers: I think there is some problem with my code, but I would like to seek you help because I can't spot it. I have a data.frame defined as follows: testdf - structure(list(yy = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,

Re: [R] Question regarding lattice::levelplot and distribution of colors

2014-07-06 Thread Duncan Mackay
Your y values are not of the type required by levelplot ? levelplot I prefer not to use themes as they do not suit my data here is a way to get what you want - colours are a bit garish but they are some easily to hand breaks/cuts are just what came in a reasonable sequence - yours to change

Re: [R] Question regarding lattice::levelplot and distribution of colors

2014-07-06 Thread Sunny Srivastava
Hello David: Thanks for your response. I am not sure, but isn't an ordered categorical variable integer for all practical purposes? (R L) Further, the problem persists if I change 'at' from seq(-0.3, 0.3, length = 20) to seq(-0.3, 0.3, length = 50; I think this argument is for the color key

[R-es] abrir varios archivos a la vez y colocarlos en un mismo data frame

2014-07-06 Thread Alejandro J. Estudillo
Buenos tardes, A ver si alguien puede ayudarme. Tengo una carpeta con 20 archivos. Cada uno de estos archivos es un data.frame con las puntuaciones de un participante. Me gustaría escribir una instrucción para que todos estos datos se agrupen en un solo data.frame. El caso es que para el

Re: [R-es] abrir varios archivos a la vez y colocarlos en un mismo data frame

2014-07-06 Thread Jorge I Velez
Estimado Alejandro, Lo mejor es trabajar con listas, sea creadas antes de o despues de leer los datos (esto ultimo automaticamente desde R). En cuanto a los nombres de las variables, creo que ahorras tiempo y problemas si los incluyes. A continuacion un ejemplo (necesitas el paquete mets): #

Re: [R-es] abrir varios archivos a la vez y colocarlos en un mismo data frame

2014-07-06 Thread Alejandro José Estudillo Hidalgo
Gracias por tu respuesta Jorge. El problema es que necesito que el nombre de las variables sólo aparezca en la primera fila de la matriz de datos final. Es para poder realizar análisis. Por eso en mi instrucción le pedía que leyese los nombre de las variables pero sólo para la el primer