[R] which element is duplicated?

2018-11-12 Thread Duncan Murdoch
The duplicated() function gives TRUE if an item in a vector (or row in a matrix, etc.) is a duplicate of an earlier item. But what I would like to know is which item does it duplicate? For example, v <- c("a", "b", "b", "a") duplicated(v) returns [1] FALSE FALSE TRUE TRUE What I want is

Re: [R] which element is duplicated?

2018-11-12 Thread Pages, Herve
Hi, On 11/12/18 17:08, Duncan Murdoch wrote: > The duplicated() function gives TRUE if an item in a vector (or row in > a matrix, etc.) is a duplicate of an earlier item.  But what I would > like to know is which item does it duplicate? > > For example, > > v <- c("a", "b", "b", "a") >

Re: [R] semiparametric manova

2018-11-12 Thread Yectli Huerta via R-help
thanks for the replies. i don't believe the data is the problem. here you see how i used 3 variables and it fails, but when i use any combination of 2 variables, it does work > head(df)    V1 V2 V3 V4 V5   V6   V7 1 200 16 16  3 64 5.584092e+13 1.616745e+12 2 200 16 16  3 64

Re: [R] semiparametric manova

2018-11-12 Thread David L Carlson
With two variables there are no combinations with less than 2 observations. Here's the part of the data you provided: > df <- structure(list(V1 = c(200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 350, 350, 350, 350,

Re: [R] saveRDS() and readRDS() Why? [solved, pretty much anyway)

2018-11-12 Thread William Dunlap via R-help
You wrote: ## On Windows 3.4.2 > x <- airquality > saveRDS(x, file = "x.rds") > saveRDS(x, file = "y.rds") > Files x.rds and y.rds are identical in size but utterly different in content. Wow! Can you show us the results of x <- datasets::airquality saveRDS(x, file="x.rds")

Re: [R] which element is duplicated?

2018-11-12 Thread Michael Sumner
what about as.integer(factor(v, levels = unique(v))) I recall very clearly when I realized the power of this feature of factor(), but I've not seen it discussed much. Cheers, Mike. On Tue, 13 Nov 2018 at 12:08 Duncan Murdoch wrote: > The duplicated() function gives TRUE if an item in a

Re: [R] which element is duplicated?

2018-11-12 Thread Bert Gunter
> match(v, unique(v)) [1] 1 2 2 1 Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Mon, Nov 12, 2018 at 5:08 PM Duncan Murdoch wrote: > The duplicated()

Re: [R] semiparametric manova

2018-11-12 Thread David Winsemius
On 11/12/18 12:37 PM, Yectli Huerta via R-help wrote: > Hello, > > I was wondering if there are other packages like MANOVA.RM that could be used > to analysis non normal distributions. I have to analyze data with more than 2 > predictor variables and a similar number of response variables.

Re: [R] saveRDS() and readRDS() Why? [solved, pretty much anyway)

2018-11-12 Thread p_connolly
On 2018-11-13 12:55, William Dunlap wrote: You wrote: ## On Windows 3.4.2 x <- airquality saveRDS(x, file = "x.rds") saveRDS(x, file = "y.rds") Files x.rds and y.rds are identical in size but utterly different in content. Wow! Can you show us the results of x <- datasets::airquality

Re: [R] which element is duplicated?

2018-11-12 Thread Bert Gunter
It is not clear to what you want for the general case. Perhaps: > v <- letters[c(2,2,1,2,1,1)] > wh <- tapply(seq_along(v),factor(v), '[',1) > w <- wh[match(v,v[wh])] > w b b a b a a 1 1 3 1 3 3 > ## and if you want NA's for the first occurences of unique values > ## of course: > w[wh] <- NA > w

Re: [R] which element is duplicated?

2018-11-12 Thread Bert Gunter
"I'd like to see a cleverer solution that vectorizes..." and Herve provided it. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Mon, Nov 12, 2018 at 9:43 PM

Re: [R] saveRDS() and readRDS() Why? [solved, pretty much anyway)

2018-11-12 Thread Patrick Connolly
The solution was very simple. Don't use the same name for the rds file as used for the R object, viz a vie: saveRDS(x, file = "x.rds") and x <- readRDS(file = "x.rds") will not work; however saveRDS(x, file = "y.rds") and x <- readRDS(file = "y.rds") will work. An undocumented feature?

Re: [R] Reporting binomial logistic regression from R results

2018-11-12 Thread PIKAL Petr
Dear Frodo (or Jedi) The results seems to confirm your assumption that 3 systems are different. How you should present results probably depends on how it is usual to report such results in your environment. BTW. It seems to me like homework and this list has no homework policy (Sorry, if I am

[R] How to create gridded data

2018-11-12 Thread lily li
Hi R users, I have a question about manipulating data. For example, I have DF1 as the following, how to transform it to a gridded dataset DF2? In DF2, each value Precip is an attribute of the corresponding grid cell. So DF2 is like a spatial surface, and can be imported to ArcGIS. Thanks for your

Re: [R] Reporting binomial logistic regression from R results

2018-11-12 Thread Frodo Jedi
Dear Petr, thank you very much for your feedback. Can anyone in the list advise me if the way I report the results is correct? Kind regards FJ On Mon, Nov 12, 2018 at 1:02 PM PIKAL Petr wrote: > Hi Frodo > > > > I do not consider myself as an arbiter in statistical results and their >

Re: [R] Reporting binomial logistic regression from R results

2018-11-12 Thread peter dalgaard
Yes, only one of the pairwise comparisons (B vs. C) is right. Also, the overall test has 3 degrees of freedom whereas a comparison of 3 groups should have 2. You (meaning Frodo) are testing that _all 3_ regression coefficients are zero, intercept included. That would imply that all three

Re: [R] Reporting binomial logistic regression from R results

2018-11-12 Thread Eik Vettorazzi
Dear Jedi, please use the source carefully. A and C are not statistically different at the 5% level, which can be inferred from glm output. Your last two wald.tests don't test what you want to, since your model contains an intercept term. You specified contrasts which tests A vs B-A, ie A-

Re: [R] Reporting binomial logistic regression from R results

2018-11-12 Thread PIKAL Petr
Hi Frodo I do not consider myself as an arbiter in statistical results and their presentation. Again your text seems to as good as any other. You should keep responses to mailing list as others could have another opinion. Cheers Petr From: Frodo Jedi Sent: Monday, November 12, 2018 1:48 PM

Re: [R] Reporting binomial logistic regression from R results

2018-11-12 Thread Frodo Jedi
Dear Peter and Eik, I am very grateful to you for your replies. My current understanding is that from the GLM analysis I can indeed conclude that the response predicted by System A is significantly different from that of System B, while the pairwise comparison A vs C leads to non significance. Now

Re: [R] Reporting binomial logistic regression from R results

2018-11-12 Thread Bert Gunter
Generally speaking, this list is about questions on R programming, not statistical issues. However, I grant you that your queries are in something of a gray area intersecting both. Nevertheless, based on your admitted confusion, I would recommend that you find a local statistical expert with whom

Re: [R] Reporting binomial logistic regression from R results

2018-11-12 Thread Frodo Jedi
Dear Bert, I understand and thanks for your recommendation. Unfortunately I do not have any possibility to contact a statistical expert at the moment. So this forum experts' recommendation would be crucial to me to understand how R works in relation to my question. I hope that someone could reply

Re: [R] semiparametric manova

2018-11-12 Thread David L Carlson
The error message does not say anything about having more than two predictor variables. It says that one of the combinations of the predictor variables has less than 2 observations (i.e. 1 or 0 observations). That is probably an issue of your sample size. You may need to consider combining some

Re: [R] missRanger package

2018-11-12 Thread Bert Gunter
You have asked what I believe is an incoherent question, and thus are unlikely to receive any useful replies (of course, I may be wrong about this...). Please read and follow the posting guide linked below to to ask a question that can be answered. Bert Gunter "The trouble with having an open

Re: [R] missRanger package

2018-11-12 Thread MacQueen, Don via R-help
I could not find the word "censor" in the documentation for the missRanger package, so I think additional explanation is needed. Also, I would expect information about censoring to be included in data provided to a function in a package -- inserting censoring into a package doesn't make sense.

[R] missRanger package

2018-11-12 Thread Rebecca Bingert
Hi, does anybody know where I need to insert the censoring in the missRanger package? Regards, Rebecca __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

[R] semiparametric manova

2018-11-12 Thread Yectli Huerta via R-help
Hello, I was wondering if there are other packages like MANOVA.RM that could be used to analysis non normal distributions. I have to analyze data with more than 2 predictor variables and a similar number of response variables. When I try the function MANOVA.wide with more than 2 predictor

Re: [R] saveRDS() and readRDS() Why? [solved, pretty much anyway)

2018-11-12 Thread p_connolly
On 2018-11-12 22:49, peter dalgaard wrote: Er, where, what, how? I can't reproduce that, at least not on 3.5.1 on MacOS: x <- airquality saveRDS(x, file = "x.rds") x <- NULL x <- readRDS(file = "x.rds") x Ozone Solar.R Wind Temp Month Day 1 41 190 7.4 67 5 1 2 36

[R-es] Materiales - V Xornada de Usuarios de R en Galicia

2018-11-12 Thread miguel.angel.rodriguez.muinos
Hola. Por si es de vuestro interés, os informo de que ya están disponibles las presentaciones y los videos de la Jornada de usuarios de Galicia, que tuvo lugar el 25 de Octubre en Santiago de Compostela. https://www.r-users.gal/pagina/programa-2018 Un Saludo, -- Miguel Ángel Rodríguez

Re: [R-es] Materiales - V Xornada de Usuarios de R en Galicia

2018-11-12 Thread ceveve
Mil gracias. El lun., 12 nov. 2018 a las 4:58, escribió: > Hola. > > Por si es de vuestro interés, os informo de que ya están disponibles las > presentaciones y los videos de la Jornada de usuarios de Galicia, que tuvo > lugar el 25 de Octubre en Santiago de Compostela. > >

Re: [R-es] Materiales - V Xornada de Usuarios de R en Galicia

2018-11-12 Thread miguel.angel.rodriguez.muinos
Gracias a vosotros, Carlos. Que los del grupo de Madrid sois hiperactivos y, gracias a eso, tenemos un mont�n de materiales. :-) Buen trabajo (y seguid as�, porfa!) De: Carlos Ortega Enviado: lunes, 12 de noviembre de 2018 14:25 Para: Rodr�guez

Re: [R-es] curso

2018-11-12 Thread miguel.angel.rodriguez.muinos
Hola David. Creo que te confundes de destinatario. Esta es la lista R-help-es (R en castellano) y no organiza cursos. Seguramente te has anotado a algún curso (Coursera, quizás?) y han referenciado esta lista pero no tiene nada que ver con la organización del curso. Un saludo.

[R-es] curso

2018-11-12 Thread David Montes
Buenas tardes: No puedo pagar curso, he hecho ejercicios y he visto todos los videos, anularme si quereis si sacais otra vez curso cuando trabaje si me gustaria pagar y sacarme el titulo, gracias. Atentamente David Montes Navarro. Good day: I can not pay for the course, but you can also watch

Re: [R-es] Materiales - V Xornada de Usuarios de R en Galicia

2018-11-12 Thread José Luis Cañadas
Gracias Miguel Angel El lun., 12 nov. 2018 a las 12:08, ceveve () escribió: > Mil gracias. > > El lun., 12 nov. 2018 a las 4:58, > > escribió: > > > Hola. > > > > Por si es de vuestro interés, os informo de que ya están disponibles las > > presentaciones y los videos de la Jornada de usuarios

Re: [R-es] Materiales - V Xornada de Usuarios de R en Galicia

2018-11-12 Thread Carlos Ortega
Gracias Miguel Ángel!. El lun., 12 nov. 2018 a las 11:58, escribió: > Hola. > > Por si es de vuestro interés, os informo de que ya están disponibles las > presentaciones y los videos de la Jornada de usuarios de Galicia, que tuvo > lugar el 25 de Octubre en Santiago de Compostela. > >

Re: [R-es] Materiales - V Xornada de Usuarios de R en Galicia

2018-11-12 Thread Carlos Ortega
Gracias!. Parece que hemos cogido un nuevo impulso si cabe al cambiar de sitio a uno más céntrico..a ver si se confirma el buen momento... Tuvimos entre 50-60 personas en la última reunión, veremos este miércoles... No creo que pueda pasarme a las Jornadas en Murcia, pero si el año que viene son

[R-es] 55 Reunión Grupo Usuarios de R de Madrid...

2018-11-12 Thread Carlos Ortega
Buenas a todos, Para los que estéis en Madrid el próximo miércoles tendremos la siguiente reunión del Grupo de R de Madrid. https://www.meetup.com/es-ES/Grupo-de-Usuarios-de-R-de-Madrid/events/256121363/ Y para los que no puedan pasarse, el material: presentaciones y videos, estarán disponibles