Back
I just want to convert the following SQL commands in R using the dplyr library.
select v1, v2, max(v2) as v3 from (select v1, v2 from data1 where v1<10)group by v1, v2;
select v1, v2, max(v2) as v3
from (select v1, v2
from data1
where v1<10)
group by v1, v2;
Kindly guide me on this.
For that you just have to execute the one line code in R programming:
data1 %>% filter(v1<10) %>% group_by(v1,v2) %>% summarize(v3 = max(v2)) %>% ungroup()
31k questions
32.8k answers
501 comments
693 users