Skip to content
Permalink
0a28308557
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
37 lines (30 sloc) 836 Bytes
library(tidyverse)
library(nycflights13)
dim(flights)
flights
slice(flights, 87:96)
top_n(flights,20)
filter(flights,month==1,day==1)
set.seed(123)
sample_n(flights,20)
0.001*nrow(flights)
sample_frac(flights,0.001)
arrange(flights,year,month,day)
arrange(flights,desc(arr_delay)) #descending order
names(flights)
select(flights,year,month,day)
select(flights,year:day)
select(flights,-year)
slect(flights,-(year:day))
select(flights, starts_with("sched"))
select(flights,ends_with("delay"))
select(flights,contains("arr"))
select(flights,matches("*_*_*")) #regular expression matching
select(flights,last_col())
dim(flights)
dim(distinct(flights))
distinct(select(flights,month,day))
distinct(flights,month,day) #same as line above
sat=pull(flights,sched_arr_time)
summary(sat)
rename(flights,dest=destination,tail_num=tailnum)