Changeset: 2c19c913e15d for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2c19c913e15d Modified Files: clients/R/Tests/dplyr.R Branch: default Log Message:
R connector, dplyr test case update diffs (43 lines): diff --git a/clients/R/Tests/dplyr.R b/clients/R/Tests/dplyr.R --- a/clients/R/Tests/dplyr.R +++ b/clients/R/Tests/dplyr.R @@ -98,10 +98,39 @@ print(nrow(head(anti_join(player_info, h })) # TODO: set ops + # sample functions print(nrow(sample_n(player_info, 24L))) print(nrow(head(sample_frac(player_info, .5), n=25L))) + +dbWriteTable(dps$con, "mtcars", mtcars) +my_tbl <- tbl(dps, "mtcars") + +# https://github.com/hadley/dplyr/issues/1165 +my_tbl %>% + group_by( cyl , gear ) %>% + summarise( n = n() ) + +# this works fin +my_tbl %>% + group_by( cyl , gear ) %>% + summarise( n = n() ) + +my_tbl %>% + group_by( cyl , gear ) %>% + tally %>% + group_by( cyl ) %>% + mutate( pct = ( 100 * n ) / sum( n ) ) + +my_tbl %>% + group_by( cyl , gear ) %>% + summarise( n = n() ) %>% + mutate( pct = 100 * n / sum( n ) ) + +dbRemoveTable(dps$con, "mtcars") + + # Arbitrary SQL ------------------------------------------------------------- # You can also provide sql as is, using the sql function: batting2008 <- tbl(dps, _______________________________________________ checkin-list mailing list [email protected] https://www.monetdb.org/mailman/listinfo/checkin-list
