Re: [R] Tricky filtering

2019-10-31 Thread Cacique Samurai
> test$flag <- ave(test$m, test$Date, FUN=function(x) max(x) == x) > test$keep <- test$flag + (test$Station == "ETE01")*1 > > but you need to think about questions asked by Bert. > > Cheers > Petr > > > -Original Message- > > From: R-help On Be

Re: [R] Tricky filtering

2019-10-31 Thread Cacique Samurai
in his "Bloom County" comic strip ) > > > On Wed, Oct 30, 2019 at 7:55 PM Cacique Samurai > wrote: > >> Hi all, >> >> I had a fish telemetry data with more then 11 million lines. I had some >> false records in the data, that I have to eliminate. I can

[R] Tricky filtering

2019-10-30 Thread Cacique Samurai
Hi all, I had a fish telemetry data with more then 11 million lines. I had some false records in the data, that I have to eliminate. I can solve this using a loop, but I think that dplyr:: filter could be faster and elegant. I just can't figure out how to do it. At this moment, I already summariz

[R] using if else function to complete a column in data frame

2017-01-08 Thread Cacique Samurai
Hello all! I´m trying to complete the "movimento" column in dataframe based in the values of "kmr" column in two sequential lines, as below: data example (dput in the end of email): IDkmr movimento 510.700 314.20NA 110.700 278.74NA 210.700 278.74N

[R] Special sequence

2016-02-29 Thread Cacique Samurai
Hello Helpers! How to create a number sequence from1 to 3000, but usigm four numbers like 0001, 0002...0102...3000. Thanks in advanced, Raoni -- Raoni Rosa Rodrigues Research Associate of Fish Transposition Center CTPeixes Universidade Federal de Minas Gerais - UFMG Brasil rodrigues.ra...@gmai

[R] coxme adequacy check

2015-10-28 Thread Cacique Samurai
Hello all! I´m fitting a mixed effects cox model with coxme function of coxme package. I want to konw what is the best way to check the model adequacy, once that function cox.zph does not work for coxme objects. Thanks in advanced, Raoni -- Raoni Rosa Rodrigues Research Associate of Fish Trans

[R] coxme adequacy check

2015-10-27 Thread Cacique Samurai
Hello all! I´m fitting a mixed effects cox model with coxme function of coxme package. I want to konw what is the best way to check the model adequacy, once that function cox.zph that does not work for coxme objects. Thanks in advanced, Raoni -- Raoni Rosa Rodrigues Research Associate of Fish

Re: [R] Formating time in R

2015-10-26 Thread Cacique Samurai
74) > days2(test) > > [1] "34H 11M 35S" "41M 17S" > > Jean > > On Mon, Oct 26, 2015 at 1:48 PM, Cacique Samurai > wrote: >> >> Hello R-Helpers! >> >> I have a vector of times of events that time is fraction of 1, because >> it

[R] Formating time in R

2015-10-26 Thread Cacique Samurai
Hello R-Helpers! I have a vector of times of events that time is fraction of 1, because it was calculated in excel. Are there some way to format a period greater than 24h in a format like excel [h]:mm:ss? Exemple: test = c(1.424708, 0.028674) > chron (times. = test [2], format = "h:m:S") [1] 00

[R] Formating time in R

2015-10-26 Thread Cacique Samurai
Hello R-Helpers! I have a vector of times of events that time is fraction of 1, because it was calculated in excel. Are there some way to format a period greater than 24h in a format like excel [h]:mm:ss? Exemple: test = c(1.424708, 0.028674) > chron (times. = test [2], format = "h:m:S") [1] 00

Re: [R] Data-frame selection

2015-10-11 Thread Cacique Samurai
Hi Peter and Jeff! Thanks very much for your code! Both worked perfectly in my data set!! All best, Raoni 2015-10-10 21:40 GMT-03:00 peter dalgaard : > >> On 11 Oct 2015, at 02:12 , Jeff Newmiller wrote: >> >> Sorry I missed the boat the first time, and while it looks like Peter is >> getting

Re: [R] Data-frame selection

2015-10-10 Thread Cacique Samurai
gt; Research Engineer (Solar/BatteriesO.O#. #.O#. with > /Software/Embedded Controllers) .OO#. .OO#. rocks...1k > ------- > Sent from my phone. Please excuse my brevity. > >

[R] Data-frame selection

2015-10-10 Thread Cacique Samurai
Hello R-Helpers! I have a data-frame as below (dput in the end of mail) and need to select just the first sequence of occurrence of each "Group" in each "ID". For example, for ID "1" I have two sequential occurrences of T2 and two sequential occurrences of T3: > test [test$ID == 1, ] ID Group