Re: [R] Merging a dataframe after subsetting with respect to several factors

2019-06-13 Thread Jeff Newmiller
Sorry... I missed that the mailing list had been removed from this email. Tina... always keep the mailing list included when you ask questions. On Thu, 13 Jun 2019, Jeff Newmiller wrote: I am sorry I did not read more closely earlier... I agree with Bert... you do need to spend some time

Re: [R] Merging a dataframe after subsetting with respect to several factors

2019-06-13 Thread Bert Gunter
Jeff: Your solution is not quite what she asked for (she wanted a data frame, not a list). Moreover, most of the time it is done automatically as the first step of a tapply() /filter() type operation or is inherent in modeling and trellis-type plots. I *still* suspect it is unnecessary, but of

Re: [R] work on R speed?

2019-06-13 Thread Jeff Newmiller
Your question seems like an information-free zone. "Quick" is an opinion unless you set the boundaries of your question much more precisely. The Posting Guide strongly recommends providing a reproducible example of what you want to discuss. In this case I would suggest that you use the

Re: [R] Merging a dataframe after subsetting with respect to several factors

2019-06-13 Thread Jeff Newmiller
I do it regularly. Base R: result <- split( DF[ , 4, drop=FALSE ], DF[ , -4 ] ) Tidyverse: library(tidyr) result <- nest( DF, time ) filter( result, "a2"==a & "b1"==b & "c1"==c )[[ "data" ]] On Thu, 13 Jun 2019, Bert Gunter wrote: Why? I suspect that there is no reason that you need to do

Re: [R] [FORGED] Merging a dataframe after subsetting with respect to several factors

2019-06-13 Thread Rolf Turner
On 14/06/19 5:30 AM, Tina Chatterjee wrote: Hello everyone! I have the following dataframe(df). a<-c("a1","a2","a2","a1","a1","a1") b<-c("b1","b1","b1","b1","b1","b2") c<-c("c1","c1","c1","c1","c1","c2") time <- c(runif(6,0,1)) I know that it's basically harmless, but it drives me nuts

Re: [R] plotting an isosurface on a 3d plot

2019-06-13 Thread Duncan Murdoch
On 13/06/2019 4:32 p.m., Duncan Murdoch wrote: On 13/06/2019 12:47 p.m., ravi via R-help wrote: Hi,I want to plot a surface joining a circle on a plane with another circle (a little offset w.r.t. the first one) on a parallel plane. This is a very simplified version of my problem. I will

Re: [R] Merging a dataframe after subsetting with respect to several factors

2019-06-13 Thread Bert Gunter
Why? I suspect that there is no reason that you need to do this. 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 ) On Thu, Jun 13, 2019 at 1:22 PM

Re: [R] Merging a dataframe after subsetting with respect to several factors

2019-06-13 Thread Richard O'Keefe
How about just df$time[match(paste(df$a, df$b, df$c), c( "co mb o1", .. "co mb oN"))] On Fri, 14 Jun 2019 at 08:22, Tina Chatterjee wrote: > Hello everyone! > I have the following dataframe(df). > > a<-c("a1","a2","a2","a1","a1","a1") > b<-c("b1","b1","b1","b1","b1","b2") >

Re: [R] plotting an isosurface on a 3d plot

2019-06-13 Thread Duncan Murdoch
On 13/06/2019 12:47 p.m., ravi via R-help wrote: Hi,I want to plot a surface joining a circle on a plane with another circle (a little offset w.r.t. the first one) on a parallel plane. This is a very simplified version of my problem. I will explain with the following code : # First, I plot the

[R] Merging a dataframe after subsetting with respect to several factors

2019-06-13 Thread Tina Chatterjee
Hello everyone! I have the following dataframe(df). a<-c("a1","a2","a2","a1","a1","a1") b<-c("b1","b1","b1","b1","b1","b2") c<-c("c1","c1","c1","c1","c1","c2") time <- c(runif(6,0,1)) df<-data.frame(a,b,c,time) df a b c time 1 a1 b1 c1 0.28781082 2 a2 b1 c1 0.02102591 3 a2 b1 c1

[R] plotting an isosurface on a 3d plot

2019-06-13 Thread ravi via R-help
Hi,I want to plot a surface joining a circle on a plane with another circle (a little offset w.r.t. the first one) on a parallel plane. This is a very simplified version of my problem. I will explain with the following code : # First, I plot the two circlesorig1 <- 0.4;radius1=0.3;theta <-

Re: [R] Help with another ggplot error

2019-06-13 Thread Bill Poling
UGH! I stared and stared at this thinking I may have a typo and did not see it! Thank you very much Sir! WHP autocorrelate <- function(data, value, lags = 0.20) { #lags Not Lags! Sheesh! value_expr <- enquo(value) acf_values <- data %>% select(!! value_expr) %>% pull() %>%

Re: [R] Help with another ggplot error

2019-06-13 Thread William Dunlap via R-help
> Hello I have created a function called autocorrelate. > > When I run it with ggplot I get this error: > #Error in autocorrelate(., NetEditRev, lags = 0:nrow(.)) : unused argument (lags = 0:nrow(.)) This means that autocorrelate does not have an argument called lags. E.g. > f <-

[R] Help with another ggplot error

2019-06-13 Thread Bill Poling
#RStudio Version 1.2.1335 sessionInfo() #R version 3.5.3 (2019-03-11) #Platform: x86_64-w64-mingw32/x64 (64-bit) #Running under: Windows >= 8 x64 (build 9200) Hello I have created a function called autocorrelate. When I run it with ggplot I get this error: #Error in autocorrelate(.,

Re: [R] [Rd] Open a file which name contains a tilde

2019-06-13 Thread Paul McQuesten
Gabriel, I apologize. I did not mean to flame, merely to point out a typical usage of tilde that might have escaped the discussion. As you say, Kurt's fix makes this all moot. I also apologize for wasting everyone's time with my spam. On Thu, Jun 13, 2019 at 2:13 AM Gabriel Becker wrote: > At

Re: [R-es] Problema de INSERT en Windows SQL

2019-06-13 Thread Ruben Tobalina Ramirez
Hola Jorge, he probado con RODBCy me ha funcionado a la primera! Como diría áquel: "¡Ójala te hubiera conocido antes!" Muchísimas gracias!! Un abrazo! Rubén, El jue., 13 jun. 2019 a las 12:51, Jorge Pradas () escribió: > Hola Ruben, > > yo uso el paquete RODBC y no suelo tener problemas. > Lo

[R] R C API Resize matrix

2019-06-13 Thread Morgan Morgan
Hi, Is there a way to resize a matrix defined as follows: SEXP a = PROTECT(allocMatrix(INTSXP, 10, 2)); int *pa = INTEGER(a) To row = 5 and col = 1 or do I have to allocate a second matrix "b" with pointer *pb and do a "for" loop to transfer the value of a to b? Thank you Best regards Morgan

Re: [R-es] Problema de INSERT en Windows SQL

2019-06-13 Thread Jorge Pradas
Hola Ruben, yo uso el paquete RODBC y no suelo tener problemas. Lo mejor es que la sentencia la metas en una cadena y luego la ejecutes directamente en la consola de SQL que uses, sin pasar por R, para ver que la sentencia está bien. Así viendo el código pienso que igual el problema es que las

[R-es] Problema de INSERT en Windows SQL

2019-06-13 Thread Ruben Tobalina Ramirez
Pd: Perdón por el duplicado de mensaje, se me olvido poner el asunto al anterior y me han surgido nuevas consultas. Buenos días, llevo unos dias peleando para realizar una consulta con INSERT en Windows SQL. He probado varios paquetes de R y con ninguno lo he conseguido. Ahora mismo estoy

[R] bnlearn cpquery NA problem

2019-06-13 Thread Yujian Liu
Hi all, I'm using bnlearn to build a Bayesian Network with 167 nodes. I have got the fitted network, but when I try to do inference using cpquery (or cpdist), I got this error message: Error in logical(n) : vector size cannot be NA/NaNIn addition: Warning message:In check.cpq.args(fitted =

Re: [R] [Rd] Open a file which name contains a tilde

2019-06-13 Thread Gabriel Becker
At the risk of looking silly, note that all of this is now largely moot anyway (or will be with the next release of R), thanks to Kurt Hornik's fixing of the bug in question (which he announced on this thread prior to but I read after Paul's). ~G On Wed, Jun 12, 2019 at 11:51 PM Gabriel Becker

Re: [R] [Rd] Open a file which name contains a tilde

2019-06-13 Thread Gabriel Becker
On Wed, Jun 12, 2019, 5:16 AM Paul McQuesten wrote: > @ Gabriel: > > "Avoid tilde in file names": > Not quite. > A tilde *suffix* is commonly used by *nix editors for backup files > > https://unix.stackexchange.com/questions/76189/what-does-the-tilde-mean-at-the-end-of-a-filename I'm aware of

Re: [R] [Rd] Open a file which name contains a tilde

2019-06-13 Thread Paul McQuesten
@ Gabriel: "Avoid tilde in file names": Not quite. A tilde *suffix* is commonly used by *nix editors for backup files https://unix.stackexchange.com/questions/76189/what-does-the-tilde-mean-at-the-end-of-a-filename On Wed, Jun 12, 2019 at 2:43 AM Kurt Hornik wrote: > > Duncan Murdoch

[R] work on R speed?

2019-06-13 Thread Kai Lähteenmäki
I tested Microsoft's linear algebra etc "racer", works well Alsp simmer seems to be very quick. How other developments in getting R quick? reg Kai [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and