Re: [R] Grouping Question

2020-03-21 Thread Chris Evans
ge - > From: "Ivan Krylov" > To: "Thomas Subia via R-help" > Cc: "Thomas Subia" > Sent: Sunday, 22 March, 2020 07:24:15 > Subject: Re: [R] Grouping Question > On Sat, 21 Mar 2020 20:01:30 -0700 > Thomas Subia via R-help wrote: > >> Ser

Re: [R] Grouping Question

2020-03-21 Thread Ivan Krylov
On Sat, 21 Mar 2020 20:01:30 -0700 Thomas Subia via R-help wrote: > Serial_test is a pass, when all of the Meas_test are pass for a given > serial. Else Serial_test is a fail. Use by/tapply in base R or dplyr::group_by if you prefer tidyverse packages. -- Best regards, Ivan __

[R] Grouping Question

2020-03-21 Thread Thomas Subia via R-help
Colleagues, Here is my dataset. Serial Measurement Meas_test Serial_test 1 17 failfail 1 16 passfail 2 12 passpass 2 8 passpass 2 10 pass

Re: [R] grouping question

2010-10-29 Thread will phillips
Hello Jorge, Thank you for the reply. I tried a few different things with if/else but couldn't get them to go. I really appreciate your feedback. I learned something new from this Will -- View this message in context: http://r.789695.n4.nabble.com/grouping-question-tp3019922p3019952.html Se

Re: [R] grouping question

2010-10-29 Thread will phillips
Hello Jim Wow. I tried cut but i see you have an interim step with labels a,b,c but levels night and day. i was really close to this. i have labels night,day,night and it wouldn't let me duplicate labels. I am very greatful for your input Will -- View this message in context: http://r.7896

Re: [R] grouping question

2010-10-29 Thread Jorge Ivan Velez
Hi Will, One way would be: > x [1] 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 > factor(ifelse(x>6 & x<18, 'day', 'night')) [1] night night night night night night night day day day day day day day day [16] day day day night night night night nig

Re: [R] grouping question

2010-10-29 Thread jim holtman
try this: > x [1] 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 > y <- cut(x, breaks=c(-Inf,6,18, Inf), labels=c('a','b','c')) > levels(y) <- c('night','day','night') > y [1] night night night night night night night day day day day day day day day day

[R] grouping question

2010-10-29 Thread will phillips
Hello I have what is probably a very simple grouping question however, given my limited exposure to R, I have not found a solution yet despite my research efforts and wild attempts at what I thought "might" produce some sort of result. I have a very simple list of integers that range between 1 a