
上QQ阅读APP看书,第一时间看更新
Converting specific values to NA
Sometimes, we might know that a specific value in a data frame actually means that the data was not available. For example, in the dat data frame, a value of 0 for Income probably means that the data is missing. We can convert these to NA by a simple assignment:
> dat$Income[dat$Income==0] <- NA