Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in R Programming by (50.2k points)

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;

Kindly guide me on this.

1 Answer

0 votes
by (108k points)

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()

Browse Categories

...