dttm数据类型过滤

library(nycflights13)
library(tidyverse)
flights_dt <- flights %>% filter(!is.na(dep_time))
glimpse(flights_dt)
#dbl数据类型和chr数据类型过滤
test <- flights %>% filter(air_time==227)
test <- flights %>% filter(dest=="IAH")
#dttm数据类型过滤
library(lubridate)
time1 <- ymd_hms('2013-01-01 05:00:00')
test <- flights %>% filter(time_hour == ymd_hms('2013-01-01 05:00:00'))
test <- flights %>% filter(time_hour>time1)

flights$overtime <- flights$time_hour+days(1)

interval(flights$time_hour,time1)

评论

此博客中的热门博文

V2ray websocket(ws)+tls+nginx分流

Rstudio 使用代理