R 특정컬럼이 결측치인 행 제거

Jmnote (토론 | 기여)님의 2021년 8월 1일 (일) 17:16 판 (→‎같이 보기)
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)

1 개요[ | ]

R 특정컬럼의 결측치 행 제거
  • 특정컬럼이 NA인 경우 그 행을 제거하는 방법
df <- read.table( header=TRUE, stringsAsFactors=FALSE, text="
Class  Name English Math
    A Alice      90   60
    A   Bob      80   NA
    B Carol      NA   80
    B  Dave      60   90
")
df
df <- df[!is.na(df$Math),]
df

2 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}