Re: [R-es] Tranformar falsas variables char en numéricas

2015-10-08 Thread Marcelino de la Cruz
Hola, Yo creo que lo que Christian Bravo quiere hacer no es solamente saber si una columna es numeric o factor o texto, sino, si es texto o factor, comprobar si lo almacenado "parece" numérico, y en ese caso, transformarlo. Una manera de hacerlo sería la siguiente: # sacamos una copia para

Re: [R-es] Tranformar falsas variables char en numéricas (cerrado)

2015-10-08 Thread Christian Bravo Sánchez
Muchas gracias Marcelino, era exactamente lo que estaba buscando y funciona perfecto. Gracias también a Olivier y Carlos, indagaré en las funciones lapply y sapply. Saludos. El 8/10/15, Marcelino de la Cruz escribió: > Hola, > > Yo creo que lo que Christian Bravo

Re: [R-es] Tranformar falsas variables char en numéricas

2015-10-08 Thread Olivier Nuñez
> class(d$fake_char)<-"numeric" > str(d) 'data.frame': 5 obs. of 5 variables: $ char : chr "a" "b" "c" "d" ... $ fake_char: num 1 2 3 4 5 $ fac : Factor w/ 5 levels "1","2","3","4",..: 1 2 3 4 5 $ char_fac : Factor w/ 5 levels "a","b","c","d",..: 1 2 3 4 5 $ num : int 1 2

Re: [R-es] Tranformar falsas variables char en numéricas

2015-10-08 Thread Carlos Ortega
Hola, Y para cuando sepas un poco más #- unlist(lapply(d, class)) #- > unlist(lapply(d, class)) char fake_char facchar_fac num "character" "character""factor""factor" "integer" Saludos, Carlos

Re: [R] Installing pre-compiled R in Linux

2015-10-08 Thread Jeff Newmiller
There is a manual for compiling and installing R. There is also a mailing list (described in the Posting Guide) called R-devel where topics like compiling R are actually on topic, unlike here. If you have to cross-compile then you probably have a bit more work ahead of you than most users would

Re: [R] Installing different R versions

2015-10-08 Thread Luca Cerone
Dear Loris and Wolfgang, thanks a lot for the help! I wasn't aware of the module project. I'd rather use the "official" way of having co-existent R versions in this case, but is a good tool to know! Thanks again for the help! Cheers, Luca On Wed, Oct 7, 2015 at 4:27 PM, Wolfgang Raffelsberger

Re: [R] duplicate rows with rbind in a loop

2015-10-08 Thread Morgan, Martin
> -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Cara Fiore > Sent: Wednesday, October 07, 2015 11:20 PM > To: r-help@r-project.org > Subject: [R] duplicate rows with rbind in a loop > > Dear R users, > > I wrote a simple script to change the

Re: [R-es] Uso comodín

2015-10-08 Thread Francisco Rodríguez
Hay �Nombres compuestos por ejemplo Juan Francisco P�rez?�Usas siempre 2 apellidos o 1 �nico apellido? �Est�n separados los elementos del nombre por espacio o te pueden venir juntos? En todo caso creo que la librer�a stringr te permite jugar con toda esta casu�stica usando otras funciones,

Re: [R-es] Uso comodín

2015-10-08 Thread Francisco Rodríguez
R�pidamente creo que una soluci�n ser�a: str_replace De la librer�a stringr Un saludo > Date: Thu, 8 Oct 2015 09:53:11 + > From: pepe...@yahoo.es > To: r-help-es@r-project.org > Subject: [R-es] Uso comod�n > > Hola a todos > Una pregunta creo que sencilla: > Tengo un listado de nombres:Juan

Re: [R] Installing different R versions

2015-10-08 Thread Loris Bennett
Dear Luca, Luca Cerone writes: > Dear Loris and Wolfgang, > thanks a lot for the help! > > I wasn't aware of the module project. I'd rather use the "official" > way of having co-existent R versions in this case, > but is a good tool to know! As far as I can tell from a

Re: [R] rpart cutpoint interpretation

2015-10-08 Thread Therneau, Terry M., Ph.D.
The cutpoint is on the predictor, so the interpretation is the same as it is for any other rpart model. The subjects with predictor < cutpoint form one group and those > cutpoint the other. The cutpoint is chosen to give the greatest difference in "average y" between the groups. For poisson

Re: [R-es] Uso comodín

2015-10-08 Thread Carlos Ortega
Hola, Si quieres cambiar todas las ocurrencias sería "*str_replace_all()*" de esa misma librería (stringr). Si no quieres usarla por cualquier motivo, puedes hacer lo mismo con la función "*gsub()*" que está en el paquete "base" (instalada por defecto en R). Gracias, Calos Ortega

Re: [R] Installing different R versions

2015-10-08 Thread Martin Maechler
> Loris Bennett > on Thu, 8 Oct 2015 12:07:20 +0200 writes: > Dear Luca, Luca Cerone writes: >> Dear Loris and Wolfgang, thanks a lot for the help! >> >> I wasn't aware of the module project. I'd rather use the

Re: [R] Installing different R versions

2015-10-08 Thread Loris Bennett
Martin Maechler writes: >> Loris Bennett >> on Thu, 8 Oct 2015 12:07:20 +0200 writes: > > > Dear Luca, Luca Cerone writes: > > >> Dear Loris and Wolfgang, thanks a lot for the help! > >> >

[R-es] Uso comodín

2015-10-08 Thread pepeceb
Hola a todos Una pregunta creo que sencilla: Tengo un listado de nombres:Juan PereiraManuel PereiraPedro Pereira... Quiero cambiar todos los apellidos Pereira por Perez.Por ejemplo uso esta opcion:Datos$Nombre[Datos$Nombre==  "Juan Pereira"] <- "Juan Perez" Seguramente haya otros metodos para

Re: [R-es] Uso comodín

2015-10-08 Thread pepeceb
Bueno, en realidad me expliqué un poco malLo que necesito es cambiar todos los que se llamen Juan (y el apellido que sea) por Juan Perez Algo asi:  Datos$Nombre[Datos$Nombre==  "Juan *"] <- "Juan Perez" El Jueves 8 de octubre de 2015 12:11, Carlos Ortega

[R] [R-pkgs] cleangeo - Cleaning Geometries from Spatial Objects

2015-10-08 Thread Emmanuel Blondel
Dear all, I've published a new package in CRAN named "cleangeo", that aims to facilitate the cleaning of geometries from spatial objects. cleangeo was initially born from some assistance provided to users that were facing issues in processing spatial data in R (see the original post at

Re: [R] additive proportional odds model in R

2015-10-08 Thread Neverstop
Thank you David Winsemius for the answer. With the ambiguous term "additive proportional odds model", I meant the nonparametrical generalization of the parametrical proportional odds model. In other words, I meant to fit a generalized additive model (GAM) with a cumulative logit as link function.

[R] How to install packages without internet

2015-10-08 Thread FERNANDO MANSITO CABALLERO
Dear Madam/Sir, I am trying to understand how to install packages without internet and I have come to a dead end. I choose polynom (Venables & Ripley) which I first successfully installed on a computer with internet. I found that the installed package comprises a void "polynom" folder and a

Re: [R] Measure the frequencies of pairs in a matrix

2015-10-08 Thread David L Carlson
More like this? > mat <- structure(c(5, 6, 5, 5, 4, 3, 6, 7, 4, 7, 5, 5, 5, 5, 6, 5, 5, + 4, 3, 6, 7, 4, 7, 5, 5, 5, 6, 5, 4, 5, 5, 7, 5, 6, 3, 5, 6, 7, + 6, 6, 5, 4, 5, 5, 7, 5, 6, 3, 5, 6, 7, 6), .Dim = c(26L, 2L)) > > # Convert columns in mat so first column is always smaller > mat2 <-

[R] Getting McFadden's Pseudo R2 for Mixed Logit models using 'gmnl' package

2015-10-08 Thread beti
I'd like to run *Mixed Logit (MIXL)* models and *Latent Class (LC)* models to analyze Discrete Choice data. Initially, I used the /mlogit /package and function for MIXL where the /summary()/ also prints out the /McFadden's Pseudo R2/. However, to my knowledge it is not possible to run an LC model

Re: [R] How to install packages without internet

2015-10-08 Thread Sarah Goslee
Don't uncompress the package first. Either from within R: install.packages("/path/to/pgk.tar.gz", repos=NULL) or at command line R CMD INSTALL /path/to/pgk.tar.gz In either case, pay attention to any messages that R returns Sarah On Thu, Oct 8, 2015 at 7:12 AM, FERNANDO MANSITO CABALLERO

Re: [R] Measure the frequencies of pairs in a matrix

2015-10-08 Thread Hermann Norpois
Thanks a lot. This was very helpful. I want to apologise for being unprecise. My favourite solution was William's. Thanks again. 2015-10-07 18:39 GMT+02:00 William Dunlap : > You could also call table() on the columns of the input matrix, first > converting them > to factors

Re: [R] changing colors in filled.contour

2015-10-08 Thread begrinner
Thanks a lot! I see more bars now but still, more than half of the diagram is white now. Any suggestion to change that? And is it possible to invert the color scheme? (black does now stand for lower values instead of higher ones) mylevels <- seq(10,0,length=10) does not seem to work. --

[R] Books on R

2015-10-08 Thread Partners
Hi, My name is Poonam and I work with Packt Publishing. I would like to inform you that we have published the following books on R recently: Mastering R for Quantitative Finance Machine learning with R Cookbook R Data Analysis Cookbook R High Performance Programming R Data Visualization

Re: [R] additive proportional odds model in R

2015-10-08 Thread Marc Schwartz
> On Oct 8, 2015, at 4:38 AM, Neverstop wrote: > > Thank you David Winsemius for the answer. > > With the ambiguous term "additive proportional odds model", I meant the > nonparametrical generalization of the parametrical proportional odds model. > In other words, I meant

[R] ​ use of PPML (Poisson Pseudo Maximum Likelihood)

2015-10-08 Thread Сергей С .
Dear Colleagues! We use R for research. We would like to perform calculations (gravity model of trade) with the ​​ use of PPML (Poisson Pseudo Maximum Likelihood). Please explain: 1. What package in R enables us to make calculations in accordance with the PPML? We used the command glm() with

[R] suppress to bring value label with spss.system.file

2015-10-08 Thread Yongnam Kim
Hello all, I know how to suppress to bring value labels from SPSS when importing sav file using foreign package by "use.value.labels = FALSE" in read.spss function. But, I don't know how to do the same thing when using memisc pkg, in particular, with the spss.system.file function. Many thanks!

Re: [R] ​ use of PPML (Poisson Pseudo Maximum Likelihood)

2015-10-08 Thread Achim Zeileis
On Thu, 8 Oct 2015, ?? ?. wrote: Dear Colleagues! We use R for research. We would like to perform calculations (gravity model of trade) with the ?? use of PPML (Poisson Pseudo Maximum Likelihood). Please explain: 1. What package in R enables us to make calculations in accordance with

[R] How to remove the grid around the plot(ca(...)) function?

2015-10-08 Thread Luca Meyer
Hello R-experts, Could anyone suggest how I can remove the grid coming out of the plot(ca(...)) function? For instance I have: library(ca) v1 <- c(10,15,20,15,25) v2 <- c(23,4,7,12,2) v3 <- c(10,70,2,3,7) d1 <- data.frame(v1,v2,v3) rownames(d1) <- c("B1","B2","B3","B4","B5") plot(ca(d1), mass =

Re: [R] How to install packages without internet

2015-10-08 Thread David Winsemius
On Oct 8, 2015, at 7:29 AM, Sarah Goslee wrote: > Don't uncompress the package first. > > Either from within R: > > install.packages("/path/to/pgk.tar.gz", repos=NULL) I think at least one OS will require that you also include type="source" and I would advise including dependencies=TRUE. >

Re: [R] Attaching a pdf file to an email generated with sendmailR?

2015-10-08 Thread Michael Ashton
No particular reason for sendmailR...I will try mailR and thanks! On Oct 8, 2015, at 4:49 PM, Frans Marcelissen > wrote: Hi Michael, I don't know whether there is a particulal reason for using sendmailR, but I use mailR

Re: [R] [FORGED] How to remove the grid around the plot(ca(...)) function?

2015-10-08 Thread Paul Murrell
Hi The plot.ca() function contains explicit calls to axis(), box(), and abline(), so, for example, ... plot(ca(d1), mass = c(TRUE,FALSE), xlab="", ylab="", axes=FALSE) ... does not work. One option is draw-it-yourself (as suggested by David Carlson), another option is to copy the function

Re: [R] regex - extracting 2 numbers and " from strings

2015-10-08 Thread David Winsemius
On Oct 8, 2015, at 3:45 PM, Omar André Gonzáles Díaz wrote: > Hi I have a vector of 100 elementos like this ones: > > a <- c("SMART TV LCD FHD 70\" LC70LE660", "LED FULL HD 58'' LE58D3140") > > I want to put just the (70\") and (58'') in a vector b. > sub("(^.+ )(\\d+)([\"]|[']{2})(.+$)",

Re: [R] Attaching a pdf file to an email generated with sendmailR?

2015-10-08 Thread Frans Marcelissen
Hi Michael, I don't know whether there is a particulal reason for using sendmailR, but I use mailR for this without any problem. mailR::send.mail(from, to, subject = "", body = "", encoding = "iso-8859-1", html = FALSE, inline = FALSE, smtp = list(), authenticate = FALSE, send = TRUE,

[R] regex - extracting 2 numbers and " from strings

2015-10-08 Thread Omar André Gonzáles Díaz
Hi I have a vector of 100 elementos like this ones: a <- c("SMART TV LCD FHD 70\" LC70LE660", "LED FULL HD 58'' LE58D3140") I want to put just the (70\") and (58'') in a vector b. This is my try, but is not working: b <- grepl('^[0-9]{2}""$',a) Any hint is welcome, thanks.

Re: [R] can't install DESEq2 on Mac

2015-10-08 Thread Morgan, Martin
Please ask questions about Bioconductor packages on the Bioconductor support site, https://support.bioconductor.org. This looks like R encountered an http error instead of the file it was expecting. Martin > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On

Re: [R] How to remove the grid around the plot(ca(...)) function?

2015-10-08 Thread David L Carlson
You will have to construct it yourself using plot(), points(), and text(): > d1.ca <- ca(d1) > d1.plt <- plot(d1.ca) d1.ca$rowmass will contain the row masses and d1.ca$colmass the column masses d1.ca$rownames and d1.ca$colnames, the names d1.plt$rows has the row coordinates and d1.plt$cols,

[R] Smoth matplot

2015-10-08 Thread bgnumis bgnum
Hi all, I have a matrix data and I use to plot matplot, it is suposed each column is a temporal series. As you see in the example the matrix o data have "peaks" I want to plot (using matplot or what yoy can say me) this matrix but with and smoothed line envoloving the values of the matrix so

Re: [R] [FORGED] Time Series Daily Frequency Part of a Year

2015-10-08 Thread Rolf Turner
I have made no attempt to think deeply about this, but it seems to me that the structure of your data does not fit into any "standard" time series model. You would appear to have a number (how many?) of *intrinsically finite* time series. In a sense you have a number of "multivariate"

Re: [R] regex - extracting 2 numbers and " from strings

2015-10-08 Thread David Wolfskill
On Thu, Oct 08, 2015 at 05:45:13PM -0500, Omar André Gonzáles Díaz wrote: > Hi I have a vector of 100 elementos like this ones: > > a <- c("SMART TV LCD FHD 70\" LC70LE660", "LED FULL HD 58'' LE58D3140") > > I want to put just the (70\") and (58'') in a vector b. > > This is my try, but is not

Re: [R] regex - extracting 2 numbers and " from strings

2015-10-08 Thread David Winsemius
On Oct 8, 2015, at 4:50 PM, Omar André Gonzáles Díaz wrote: > David, it does work but not in all cases: It should work if you change the "+" to "*" in the last capture class. It makes trailing non-digit characters entirely optional. > sub("(^.+ )(\\d+)([\"]|[']{2})(.*$)", "\\2\\3", b) [1]

Re: [R] [FORGED] Re: correlated binomial random variables

2015-10-08 Thread li li
Thanks Dennis and Rolf. Yes. Simulation is one way. I think correlation does not determine the joint distribution so it will not be unique. Under specific settings, the joint probability of X, Y can be calculated. For example, let X=X_0+X_1 and Y=X_0+X_2, with X_0 being Binomial(n_0, p) and X_1,

[R] Help with color.scale {plotrix}

2015-10-08 Thread Kumar Mainali
Hi Jim and others: I needed color code for some color gradients in color.scale function. I found that the following translates to green to yellow to red: c(0,1,1),c(1,1,0),0. How does this string translate to the color gradient? I would like to know the gradient code for red to yellow, yellow to

Re: [R] [FORGED] Time Series Daily Frequency Part of a Year

2015-10-08 Thread zod jones
Thanks for the reply. I thought I'd find more on this by searching for course enrollment forecasting because the events I'm dealing with are essentially like courses that need to be compared year on year (over many years). But the info I found relating to models for enrollment were only aggregated

Re: [R] Installing pre-compiled R in Linux

2015-10-08 Thread Sasikumar Kandhasamy
Sure Jeff, thanks a lot for the references. Will explore more and will also try to contact R-devel list for further help on cross compile. Thanks again to all for the quick responses. Thanks & Regards Sasi On Thu, Oct 8, 2015 at 12:11 AM, Jeff Newmiller wrote: > There

[R] Attaching a pdf file to an email generated with sendmailR?

2015-10-08 Thread Michael Ashton
For some time I have been using sendmailR to generate a simple message when a report was done running. Recently, I started adding a couple of pertinent statistics in the body of the email. Now, I've finally decided that what the heck, I ought to simply attach the report itself to the email.

[R] can't install DESEq2 on Mac

2015-10-08 Thread Dawn
Hi, I can't install DESEq2 on my iMac, as follows: > source("http://bioconductor.org/biocLite.R;) Bioconductor version 3.1 (BiocInstaller 1.18.4), ?biocLite for help > biocLite("DESeq2") BioC_mirror: http://bioconductor.org Using Bioconductor version 3.1 (BiocInstaller 1.18.4), R version 3.2.2.

Re: [R] ​ use of PPML (Poisson Pseudo Maximum Likelihood)

2015-10-08 Thread Сергей С .
 Thank you very much!!! Отправлено со смартфона Исходное сообщение От: Achim Zeileis Дата: 2015.10.08 19:55 (GMT+03:00) Кому: "Сергей С." Cc: r-help@r-project.org Тема: Re: [R] ​ use of PPML (Poisson Pseudo Maximum

Re: [R] rpart cutpoint interpretation

2015-10-08 Thread Kishor Tappita
Thank you so much for the clarification Terry. On Thu, Oct 8, 2015 at 6:03 PM, Therneau, Terry M., Ph.D. wrote: > The cutpoint is on the predictor, so the interpretation is the same as it > is for any other rpart model. The subjects with predictor < cutpoint form > one