Re: [R] Different output for "if else" and "ifelse" that I don't understand

2017-04-28 Thread Bert Gunter
Typo: last line should be Even better, use p3p <- tryCatch(list(...), error=function(e) list()) Cheers, Bert 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 )

Re: [R] Different output for "if else" and "ifelse" that I don't understand

2017-04-28 Thread William Dunlap via R-help
Thank you - I did mean tryCatch. Bill Dunlap TIBCO Software wdunlap tibco.com On Fri, Apr 28, 2017 at 10:01 AM, Bert Gunter wrote: > Typo: last line should be > > Even better, use > p3p <- tryCatch(list(...), error=function(e) list()) > > > Cheers, > > Bert > > > Bert

[R] update.packages() error R 3.4.0

2017-04-28 Thread Robert Baer
Is there an easy work-around for the update.packages error I'm getting on Windows 10 with R 3.4.0? > update.packages() --- Please select a CRAN mirror for use in this session --- foreign : Version 0.8-67 installed in C:/Program Files/R/R-3.4.0/library Version 0.8-68 available at

Re: [R] update.packages() error R 3.4.0

2017-04-28 Thread Bert Gunter
Please see previous messages from today concerning this. -- Bert 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 Fri, Apr 28, 2017 at 9:58 AM, Dimitri

Re: [R] update.packages() error R 3.4.0

2017-04-28 Thread Jeff Newmiller
Ah, if you have been following along the thread.. use the patched version. -- Sent from my phone. Please excuse my brevity. On April 28, 2017 9:06:21 AM PDT, Robert Baer wrote: >Is there an easy work-around for the update.packages error I'm getting >on Windows 10 with R 3.4.0?

Re: [R] Error with installed.packages with R 3.4.0 on Windows

2017-04-28 Thread Dimitri Liakhovitski
When I click on "r patched snapshot build" here , it take me here , it says: Download R-3.3.3 Patched build for Windows

Re: [R] update.packages() error R 3.4.0

2017-04-28 Thread Dimitri Liakhovitski
I am having the same problem - just installed R 3.4.0 on my Windows laptop. Same thing with packages - exactly the same error. On Fri, Apr 28, 2017 at 12:06 PM, Robert Baer wrote: > Is there an easy work-around for the update.packages error I'm getting on > Windows 10 with R

[R] Overriding lack of i386 build for ROracle when updating packages

2017-04-28 Thread Laviolette, Michael
Since I query my Oracle warehouse often, I load the ROracle package on startup. Whenever I update packages from RStudio (which actually runs the install.packages function) with ROracle loaded, I get the following error: Error: package 'ROracle' is not installed for 'arch = i386' Unloading the

Re: [R] [FORGED] Re: How create columns for squared values from previous columns?

2017-04-28 Thread Mike C
Thanks Rolf. I was just a bit frustrated that R wouldn't generate dummy variable names on the fly. Also, another question, if I want to put column 5 at column 3, dat[, 3:5] <- dat[, c(5,3,4)] It does not work, why? From: Rolf Turner

[R] How create columns for squared values from previous columns?

2017-04-28 Thread C W
Dear R list, I am am a little unsure what is the best way to approach this. I suppose I have > dat <- matrix(rnorm(30), ncol = 5) > dat <- data.frame(dat) > dat X1 X2 X3 X4 X5 1 -1.1317 -0.87868106 -0.33000492 1.5241765 -0.92483388 2 -0.56168006

Re: [R] [FORGED] Re: How create columns for squared values from previous columns?

2017-04-28 Thread Rolf Turner
On 29/04/17 13:21, C W wrote: I came up with this solution, cbind(dat, dat[, 1:3]^2) X1 X2 X3 X4 X5 X1 X2X3 1 0.72776481 -1.1332612 -1.9857503 0.46189400 -0.09016379 0.529641625 1.28428102 3.9432044 2 0.05126592 0.2858707

Re: [R] read list of binary files and explore them

2017-04-28 Thread Bert Gunter
?readBin (a search on "read binary files R" or similar would have found this). and please spend some time with the R import/export manual + tutorials to learn how to manipulate data in R. This list expects you to make an effort to do your own work before posting. See the posting guide below for

Re: [R] How create columns for squared values from previous columns?

2017-04-28 Thread C W
I came up with this solution, > cbind(dat, dat[, 1:3]^2) X1 X2 X3 X4 X5 X1 X2X3 1 0.72776481 -1.1332612 -1.9857503 0.46189400 -0.09016379 0.529641625 1.28428102 3.9432044 2 0.05126592 0.2858707 0.9075806 1.27582713 -0.49438507

Re: [R] Opencpu and caching

2017-04-28 Thread Jeff Newmiller
A) The https://www.opencpu.org/help.html page recommends a Google Group and Stack Overflow. If you were "told" otherwise, it was probably because they thought you needed to learn R, which would be off topic for their support areas. B) The R mailing lists Posting Guide says that questions

Re: [R] Opencpu and caching

2017-04-28 Thread Jake Stone
OK, thanks for the info I apologize. I must have misread or misremembered. I have found the answer btw. R Cache serves the said purpose perfectly. On Apr 28, 2017 6:58 PM, "Jeff Newmiller" wrote: A) The https://www.opencpu.org/help.html page recommends a Google

Re: [R] Reading XML attriutes in R

2017-04-28 Thread Archit Soni
Thanks Ben, I'll give it a shot.. Thanks again :) On Apr 28, 2017 18:54, "Ben Tupper" wrote: > Hi again, > > It would be super easy if xml2::xml_attrs() accepted a list of attribute > names and defaults values like xml2::xml_attr() does, but it doesn't. Once > you have a

Re: [R] Opencpu and caching

2017-04-28 Thread Jeff Newmiller
You have already been told this is the wrong list for these questions. Go ask in the OpenCPU support areas. My very limited understanding of OpenCPU is that what you are asking for is specifically not supported. You need to setup your own function that does everything before it returns. --

Re: [R] survival package can't find Ccoxfit6

2017-04-28 Thread Henric Winell
On 2017-04-26 22:17, Duncan Murdoch wrote: On 26/04/2017 2:51 PM, Therneau, Terry M., Ph.D. wrote: A user contacted me directly about this, I answered with my best understanding of the recent R-help discussion of the issue, and their response to my response shows that I'm not quite right. I

Re: [R] Error with installed.packages with R 3.4.0 on Windows

2017-04-28 Thread Duncan Murdoch
On 28/04/2017 4:45 AM, Thierry Onkelinx wrote: Dear Peter, It actually breaks install.packages(). So it is not that innocent. I don't think he meant that it is harmless, he meant that the fix is easy, and is in place in R-patched and R-devel. You should use R-patched and you won't have the

[R] Larger rgl-images?

2017-04-28 Thread Atte Tenkanen
Hi, In package ‘VecStatGraphs3D’ is a DrawDensity3D-function in which the rgl-device size is defined as r3dDefaults$windowRect=c(0,0, WSizeWidth, WSizeHeight). To save, for instance, a png-snapshot, we can use rgl.snapshot()-function. The size of the file is dependent on the window and thus

Re: [R] Error with installed.packages with R 3.4.0 on Windows

2017-04-28 Thread peter dalgaard
> On 28 Apr 2017, at 12:08 , Duncan Murdoch wrote: > > On 28/04/2017 4:45 AM, Thierry Onkelinx wrote: >> Dear Peter, >> >> It actually breaks install.packages(). So it is not that innocent. > > I don't think he meant that it is harmless, he meant that the fix is

[R] Data.table vs dplr handling multiple variables

2017-04-28 Thread Ek Esawi
Hi All— I am often working with large datasets with multiple variables (integer, decimal, string, complex, date, and time) that require processing, cleaning, etc. I am relatively new to R and I would like to get some input on the following issue: I am trying to figure out which R-package(s) is

Re: [R] survival package can't find Ccoxfit6

2017-04-28 Thread Duncan Murdoch
On 28/04/2017 5:37 PM, Henric Winell wrote: On 2017-04-26 22:17, Duncan Murdoch wrote: On 26/04/2017 2:51 PM, Therneau, Terry M., Ph.D. wrote: A user contacted me directly about this, I answered with my best understanding of the recent R-help discussion of the issue, and their response to my

Re: [R] Error with installed.packages with R 3.4.0 on Windows

2017-04-28 Thread Uwe Ligges
On 28.04.2017 19:10, Dimitri Liakhovitski wrote: When I click on "r patched snapshot build" here , it take me here , it says: Download R-3.3.3 Patched build for Windows

Re: [R] Error with installed.packages with R 3.4.0 on Windows

2017-04-28 Thread Duncan Murdoch
On 28/04/2017 5:58 PM, Uwe Ligges wrote: On 28.04.2017 19:10, Dimitri Liakhovitski wrote: When I click on "r patched snapshot build" here , it take me here , it says: Download R-3.3.3

Re: [R] Larger rgl-images?

2017-04-28 Thread Duncan Murdoch
On 28/04/2017 5:18 AM, Atte Tenkanen wrote: Hi, In package ‘VecStatGraphs3D’ is a DrawDensity3D-function in which the rgl-device size is defined as r3dDefaults$windowRect=c(0,0, WSizeWidth, WSizeHeight). To save, for instance, a png-snapshot, we can use rgl.snapshot()-function. The size of

Re: [R] Data.table vs dplr handling multiple variables

2017-04-28 Thread Jeff Newmiller
All approaches have strong points and weak points. Your question has no clear answer. I happen to like dplyr for many things (including lots of timestamp values), but base R is always there to solve problems if the analysis framework-du-jour has troubles. So learn base R ways of doing things

[R] Opencpu and caching

2017-04-28 Thread Jake Stone
I am new to opencpu. My specialty is java. I use R for very specific analyses. *PROBLEM* My understanding is that each API call to opencpu opens a new R session. My function will classify the data input using the predict method of a linear discriminant analysis (lda from MASS package). The

[R] Augmented Dickey Fuller test

2017-04-28 Thread T . Riedle
Dear all, I am trying to run an ADF test using the adf.test() function in the tseries package and the ur.df() function in the urca package. The results I get contrast sharply. Whilst the adf.test() indicates stationarity which is in line with the corresponding graph, the ur.df() indicates

Re: [R] gap.barplot with means and standard error bars

2017-04-28 Thread Jim Lemon
Hi Bianca, Try this: gap.barplot(c(mean(SA),mean(AA),mean(CA)), gap=c(1,250),xlim=c(0.5,3.5),xaxlab=c("SA","AA","CA"), ytics=c(0,255,260,265),yaxlab=c(0,255,260,265)) barlabels(1:3,c(5,5,5), paste(c(mean(SA),mean(AA),mean(CA)), round(c(sd(SA),sd(AA),sd(CA)),3))) It's a bit rough, but I don't

Re: [R] Augmented Dickey Fuller test

2017-04-28 Thread Achim Zeileis
On Fri, 28 Apr 2017, T.Riedle wrote: Dear all, I am trying to run an ADF test using the adf.test() function in the tseries package and the ur.df() function in the urca package. The results I get contrast sharply. Whilst the adf.test() indicates stationarity which is in line with the

Re: [R] Error with installed.packages with R 3.4.0 on Windows

2017-04-28 Thread Uwe Ligges
On 28.04.2017 10:45, Thierry Onkelinx wrote: Dear Peter, It actually breaks install.packages(). So it is not that innocent. And hence, as Peter exoplained, it is already fixed inn R-patched, thanks to Tomas Kalibera. Best, Uwe Ligges Best regards, Thierry Op 28 apr. 2017 10:36

Re: [R] Reading XML attriutes in R

2017-04-28 Thread Ben Tupper
Hi again, It would be super easy if xml2::xml_attrs() accepted a list of attribute names and defaults values like xml2::xml_attr() does, but it doesn't. Once you have a list of character vectors like that returned by your ... ppt <- x %>% xml_find_all("precipitation") %>% xml_attrs() ..then

Re: [R] Different output for "if else" and "ifelse" that I don't understand

2017-04-28 Thread William Dunlap via R-help
ifelse's vectorization messes this up. You could replace your original if (class(try(list(...), silent=TRUE))=="try-error") p3p <- list() else p3p <- list(...) with p3p <- if (class(try(list(...), silent=TRUE))=="try-error") list() else list(...) instead of using ifelse, since the return

Re: [R] Reading XML attriutes in R

2017-04-28 Thread Archit Soni
Thanks Ben, got it working, just want one more help on this, If i have a node like: and in some other city it came like: How can i make my code to handle this dynamically? I am sorry to ask such novice questions but it would be extremely helpful if you could help me with this. So, i would

Re: [R] Error with installed.packages with R 3.4.0 on Windows

2017-04-28 Thread peter dalgaard
Yes, we noticed this in the last days of the code freeze before release and shied away from inserting a workaround, partly because we couldn't see what the root of the problem might be. For the purposes of installed.packages it is relatively harmless to treat the NA condition as FALSE, since

Re: [R] Error with installed.packages with R 3.4.0 on Windows

2017-04-28 Thread Thierry Onkelinx
Dear Peter, It actually breaks install.packages(). So it is not that innocent. Best regards, Thierry Op 28 apr. 2017 10:36 a.m. schreef "peter dalgaard" : Yes, we noticed this in the last days of the code freeze before release and shied away from inserting a workaround,

[R] Different output for "if else" and "ifelse" that I don't understand

2017-04-28 Thread Marc Girondot via R-help
Dear list-members, During the test phase of a function, I run it interactively (in Rstudio) and the ... produces an error. Then I use this to read it: if (class(try(list(...), silent=TRUE))=="try-error") p3p <- list() else p3p <- list(...) It works fine; interactively I will get > if

Re: [R-es] Hacer una gráfico de dispersión y línea de tendencia.

2017-04-28 Thread Carlos J. Gil Bellosta
Mira los ejemplos de ?abline. El 29 de abril de 2017, 1:03, alejandro hernández morales < hdezmor...@gmail.com> escribió: > Buenas. Espero me pueda ayudar. Tengo dos variables cuantitativas, quiero > aplicar un gráfico de dispersión y aplicarle una línea de tendencia, Pero > no veo la manera de

Re: [R-es] ggplot dentro de una función

2017-04-28 Thread Carlos J. Gil Bellosta
Usa aes_string en lugar de aes. Mira la documentación. 2017-04-28 23:39 GMT+02:00 Rubén Coca : > Hola a todos, > Partiendo de: > > library(ggplot2); library(data.table) > > datos <- data.table(Date = seq.Date(as.Date("2017-01-01"), >

Re: [R-es] ggplot dentro de una función

2017-04-28 Thread Carlos Ortega
Hola, Otra alternativa que puedes utilizar es esta: #-- grafico <- function(dt, varx) { dt <- as.data.frame(dt) p <- ggplot(dt, aes( x= Date, y= dt[,varx] ) ) p + geom_point() ## un montón de código de configuración del gráfico, etc }

[R-es] ggplot dentro de una función

2017-04-28 Thread Rubén Coca
Hola a todos, Partiendo de: library(ggplot2); library(data.table) datos <- data.table(Date = seq.Date(as.Date("2017-01-01"), as.Date("2017-01-10"), by = "day"), V1 = rnorm(10), V2 = rnorm(10))

[R-es] Hacer una gráfico de dispersión y línea de tendencia.

2017-04-28 Thread alejandro hernández morales
Buenas. Espero me pueda ayudar. Tengo dos variables cuantitativas, quiero aplicar un gráfico de dispersión y aplicarle una línea de tendencia, Pero no veo la manera de hacerlo. Agradecería su ayuda. Muchas gracias. -- *Alejandro Hernández Morales* *Departamento de Biología Marina* Centro

Re: [R-es] RStudio en Ubuntu 17.10

2017-04-28 Thread José Antonio Palazón Ferrando
Hola: Yo uso este procedimiento para instalar rstudio: wget https://download1.rstudio.org/rstudio-1.0.136-amd64.deb wget http://ftp.ca.debian.org/debian/pool/main/g/gstreamer0.10/libgstreamer0.10-0_0.10.36-1.5_amd64.deb wget

Re: [R-es] Ingresar datos dentro de R sin Excel

2017-04-28 Thread miguel.angel.rodriguez.muinos
Hola Wilmer. Has probado con el editor de datos del RCommander? Un saludo. El 28/04/2017 a las 15:35, WILMER CONTRERAS SEPULVEDA escribió: > Hola, buenos días. > > Quisiera saber si existe alguna función o libreria en R que simule la > ventana de Excel para ingresar datos. No estoy hablando de

Re: [R-es] Ingresar datos dentro de R sin Excel

2017-04-28 Thread Susana Rivera via R-help-es
Deducer: A GUI for R - Deducer Manual | | | Deducer: A GUI for R - Deducer Manual | | | Saludos, Susana De: "miguel.angel.rodriguez.mui...@sergas.es" Para: r-help-es@r-project.org Enviado: Viernes, 28 de abril, 2017 8:43:52

[R-es] Ingresar datos dentro de R sin Excel

2017-04-28 Thread WILMER CONTRERAS SEPULVEDA
Hola, buenos días. Quisiera saber si existe alguna función o libreria en R que simule la ventana de Excel para ingresar datos. No estoy hablando de importar datos de excel a R, No. Quisiera que dentro de R existiera el entorno para ingresar los datos rapidamente y no pasar por la molestia de

Re: [R-es] Ingresar datos dentro de R sin Excel

2017-04-28 Thread Javier Marcuzzi
Estimado Wilmer Es posible, le indicaron algunas opciones, pero no es recomendable, si no le molesta use el programa que más de gusta, guarde en csv, luego los importa con solo una línea de código, salvo para algunas pruebas específicas yo opto por tener los datos separados de R, aunque si sin