replace_with_na का उपयोग
पिछले डेटासेट से आगे बढ़ते हुए, अब हमें पता है कि कुछ अजीब तरह के missing values हैं.
अब, हम इस पर कार्रवाई करेंगे और replace_with_na() फंक्शन का उपयोग करके इन मानों को missing (जैसे NA) से बदलेंगे.
यह अभ्यास पाठ्यक्रम का हिस्सा है
R में Missing Data से निपटना
अभ्यास निर्देश
pacman डेटासेट के लिए:
replace_with_na()का उपयोग करकेyearऔरscoreवैरिएबल्स में"N/A","na", और"missing"missing values कोNAसे बदलें.- अंत में
miss_scan_count()का उपयोग करके जाँचें कि क्या आपने सभी missing values हटा दी हैं.
इंटरैक्टिव व्यावहारिक अभ्यास
इस अभ्यास को इस नमूना कोड को पूरा करके आज़माएँ।
# Print the top of the pacman data using `head()`
head(___)
# Replace the strange missing values "N/A", "na", and
# "missing" with `NA` for the variables, year, and score
pacman_clean <- replace_with_na(_____, replace = list(year = c(___, ___, ___),
score = c(___, ___, ___)))
# Test if `pacman_clean` still has these values in it?
miss_scan_count(____, search = list(___, ___, ___))