[R] foverlaps data.table error

2018-01-07 Thread Rahul Sharm
Hello All Have 2 tables dt1: start end kwh10min 2013-04-01 00:00:54 UTC 2013-04-01 01:00:10 UTC 0.05 2013-04-01 00:40:26 UTC 2013-04-01 00:50:00 UTC 0.1 2013-04-01 02:13:20 UTC 2013-04-01 04:53:42 UTC 0.15 2013-04-02 02:22:00 UTC 2013-04-01 04:33:12 UTC 0.2 2013-04-01 02:26:23 UTC 2013-04-01 04:05:

Re: [R] Replace NAs in split lists

2018-01-07 Thread Jeff Newmiller
Why do you want to modify df1? Why not just reassemble the parts as a new data frame and use that going forward in your calculations? That is generally the preferred approach in R so you can re-do your calculations easily if you find a mistake later. -- Sent from my phone. Please excuse my bre

Re: [R] Replace NAs in split lists

2018-01-07 Thread PIKAL Petr
Hi library(zoo) has function na.locf, which probably can do what you want. so something like (untested) sdf1.fill<-lapply(sdf1, na.locf) do.call(rbind, sdf1.fill) Cheers. Petr > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Ek Esawi > Sent: Monda

Re: [R] Replace NAs in split lists

2018-01-07 Thread Ek Esawi
I just came up with a solution right after i posted the question, but i figured there must be a better and shorter one.than my solution sdf1[[1]][1,4]<-lapplyresults[[1]] sdf1[[2]][1,4]<-lapplyresults[[2]] EK On Sun, Jan 7, 2018 at 10:13 PM, Ek Esawi wrote: > Hi all-- > > I stumbled on this prob

[R] Replace NAs in split lists

2018-01-07 Thread Ek Esawi
Hi all-- I stumbled on this problem online. I did not like the solution given there which was a long UDF. I thought why cannot split and l/s apply work here. My aim is to split the data frame, use l/sapply, make changes on the split lists and combine the split lists to new data frame with the desi

Re: [R] Defining interaction in random effects in lme4

2018-01-07 Thread Bert Gunter
Probably better to post this on the r-sig-mixed-models list. Cheers, Bert On Jan 7, 2018 12:20 PM, "Dominik Ćepulić" wrote: > Dear everybody! > > My fixed-effects-only model looks like this: glmer(Accuracy ~ C.RT*Group, > data = da) > > C.RT is the reaction time variable, and Group is a categ

[R] Defining interaction in random effects in lme4

2018-01-07 Thread Dominik Ćepulić
Dear everybody! My fixed-effects-only model looks like this: glmer(Accuracy ~ C.RT*Group, data = da) C.RT is the reaction time variable, and Group is a categorical variable with 0 and 1 as values. I would like to specify that main intercept, Group intercept, C.RT slope and C.RT*Group slope vary a

Re: [R] SpreadLevelPlot for more than one factor

2018-01-07 Thread Fox, John
Dear Ashim, Try spreadLevelPlot(breaks ~ interaction(tension, wool), data=warpbreaks) . I hope this helps, John - John Fox, Professor Emeritus McMaster University Hamilton, Ontario, Canada Web: socialsciences.mcmaster.ca/jfox/ > -Original Message- > From:

Re: [R] help needed on quantmod....

2018-01-07 Thread Rui Barradas
Hello, How are you calling your function? Can you show us the actual code? I am testing it like the following. apnd(list("IBM")) Error in download.file(paste("https://finance.yahoo.com/d/quotes.csv?s=";, : cannot open URL 'https://finance.yahoo.com/d/quotes.csv?s=IBM&f=d1t1l1c1p2ohgv' In a

Re: [R] SpreadLevelPlot for more than one factor

2018-01-07 Thread Ashim Kapoor
Dear All, I did this : > v = wool:tension > spreadLevelPlot(breaks ~ v) LowerHinge Median UpperHinge Hinge-Spread B:H 15 17 216 A:M 18 21 30 12 A:H 18 24 28 10 B:M 21 28 39