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 Sent: Friday, April 28, 201

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] [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 0.9

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 Group and Stack Overflow. If

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 about

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 0.

[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] 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. -- Sen

[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 initial

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 if

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 the

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 r

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 Patc

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 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 easy, > and is in place in R-p

[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 mos

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 y

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] 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 list of character vect

[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 p

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 Gunter > > "The trouble

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? > > > update.pac

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 Howe

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 Liakhov

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] 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 3.4.0? > >> update.pa

[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 https://mirror

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 value

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 y

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 correspo

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 a.

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

[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 non-s

[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 (clas

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, partly because we coul

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 i

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 wan