sample_df: Select sample n rows returns a data.frame

Description Usage Arguments Value Examples

Description

sample_df gets a sample of n rows from lazy evaluation object and returns a data.frame.

Usage

1
sample_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 lazy evaluation object with n rows from a data.frame.

Examples

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

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