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
date | fruit | ea |
---|---|---|
<chr> | <chr> | <int> |
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 |
Copy
df[df$date >= "2019-06-03",]
date | fruit | ea | |
---|---|---|---|
<chr> | <chr> | <int> | |
3 | 2019-06-03 | banana | 2 |
4 | 2019-06-04 | apple | 3 |
5 | 2019-06-05 | banana | 4 |
2 같이 보기[ | ]
편집자 Jmnote Jmnote bot
로그인하시면 댓글을 쓸 수 있습니다.