Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

how to select numeric columns in r

num_cols <- unlist(lapply(data, is.numeric))         # Identify numeric columns
data_num <- data[ , num_cols]  #Only select those numeric colmns
data_num_nonan <−na.omit(data_num)

#How to find the number of nan is each column in R
is.na(data_num)
colSums(is.na(data_num))
which(colSums(is.na(data_num))>0)
names(which(colSums(is.na(data_num))>0))
Source by statisticsglobe.com #
 
PREVIOUS NEXT
Tagged: #select #numeric #columns
ADD COMMENT
Topic
Name
8+7 =