na.omit Function in R (Example) | Listwise Deletion | Data Frame & Vector | Remove Incomplete Cases
Автор: Statistics Globe
Загружено: 2023-04-12
Просмотров: 1106
How to remove all incomplete cases of a data object (typically of a data frame, matrix or vector) in the R programming language. More details: https://statisticsglobe.com/na-omit-r...
R code of this video:
vec <- c(2, 6, NA, 5, 5, NA, 4, 7) # Create example vector
vec # Print example vector
vec_new <- na.omit(vec) # Apply na.omit to vector
vec_new # Print updated vector
data <- data.frame(x1 = c(9, 6, NA, 9, 2, 5, NA), # Column with 2 missing values
x2 = c(NA, 5, 2, 1, 5, 8, 0), # Column with 1 missing value
x3 = c(1, 3, 5, 7, 9, 7, 5)) # Column without missing values
data # Print data to RStudio console
data_new <- na.omit(data) # Apply na.omit to data frame
data_new # Print updated data frame
Follow me on Social Media:
Facebook – Statistics Globe Page: / statisticsglobecom
Facebook – R Programming Group for Discussions & Questions: / statisticsglobe
Facebook – Python Programming Group for Discussions & Questions: / statisticsglobepython
LinkedIn – Statistics Globe Page: / statisticsglobe
LinkedIn – R Programming Group for Discussions & Questions: / 12555223
LinkedIn – Python Programming Group for Discussions & Questions: / 12673534
Twitter: / joachimschork
Music by bensound.com

Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: