R complete.cases()

1 개요[ | ]

R complete.cases()
  • "Find Complete Cases"
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
")
complete.cases(df)
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[complete.cases(df),]
df
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
")
library(dplyr, warn.conflicts = FALSE)
df <-  df %>% filter(complete.cases(df))
df

2 같이 보기[ | ]

3 참고[ | ]

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