R 데이터프레임 특정날짜 이전 행 제거

1 개요[ | ]

R 데이터프레임 특정날짜 이전 행 제거
R
CPU
2.6s
MEM
115M
2.9s
Reload
Copy
df <- read.table( header=T, stringsAsFactors=FALSE, text="
date        fruit    ea
2019-06-01  apple    1
2019-06-02  apple    1
2019-06-03  banana   2
2019-06-04  apple    3
2019-06-05  banana   4
")
df
A data.frame: 5 × 3
datefruitea
<chr><chr><int>
2019-06-01apple 1
2019-06-02apple 1
2019-06-03banana2
2019-06-04apple 3
2019-06-05banana4
Copy
df[df$date >= "2019-06-03",]
A data.frame: 3 × 3
datefruitea
<chr><chr><int>
32019-06-03banana2
42019-06-04apple 3
52019-06-05banana4

2 같이 보기[ | ]