top_df: Select top n rows returns data.frame

Description Usage Arguments Value Examples

Description

top_df gets the top n of rows from lazy evaluation object and returns a data.frame.

Usage

1
top_df(x = NULL, n = NULL)

Arguments

x:

Lazy evaluation object. Object created from the function 'tbl'.

n:

Number of rows, n defaults to 10.

Value

Returns a data.frame with n rows from a lazy evaluation object.

Examples

1
2
3
4
5
6
7
#Top 20 rows from lazy evaluation object
   tbl(post,sql("SELECT * FROM
                 CALENDAR")) %>%
   group_by(ACCOUNT_YEAR_WEEK,
            SEASON) %>%
   summarise(WEEK_ENDING=max(CAL_DATE)) %>%
   top_df(n=20)

DyfanJones/connectR documentation built on May 23, 2019, 10:32 p.m.