base R中的table()函数可以通过useNA显示缺失值(即NA),它接受几个参数:“no”,“ifany”或“always”。
data(airquality) # loads the built-in data frame, which has NAs
table(airquality$Ozone, useNA = "always") # always displays the number of missing values
table(airquality$Wind, useNA = "ifany") # only displays the number of missing values if there are some
2条答案
按热度按时间rjee0c151#
base R中的
table()
函数可以通过useNA
显示缺失值(即NA),它接受几个参数:“no”,“ifany”或“always”。字符串
piok6c0g2#
一个可能的解决方案:
字符串