Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
重複の可能性: NAをテストし、結果に基づいて値を選択します
ベクトルがあると仮定します-ベクトルで計算を行います-要素の多くは「NA」を返します-これらの「NA」をどのように識別し、使用可能な整数に変更しますか
データが入っていると仮定しますdat(ベクトル、行列、またはデータ フレームの可能性があります)。
dat
dat[is.na(dat)]<-0
NAのすべてのエントリを にdat置き換えます0。
NA
0