rtidyversemissing-datananiar

R is not detecting all the missing values with naniar package or colSums


The data I am working with is the Top 1000 IMDB movies from Kaggle (https://www.kaggle.com/harshitshankhdhar/imdb-dataset-of-top-1000-movies-and-tv-shows/download)

Here to demonstrate the problem I am considering the first 100 observations after discarding some variables. (Pardon me, it is a bit long)

structure(list(Released_Year = structure(c(73L, 51L, 87L, 53L, 
36L, 82L, 73L, 72L, 89L, 78L, 80L, 73L, 45L, 81L, 78L, 69L, 59L, 
54L, 99L, 98L, 99L, 93L, 81L, 80L, 77L, 78L, 76L, 74L, 70L, 56L, 
41L, 33L, 25L, 98L, 93L, 90L, 85L, 85L, 81L, 79L, 77L, 74L, 73L, 
73L, 70L, 67L, 67L, 64L, 47L, 39L, 21L, 15L, 10L, 97L, 96L, 96L, 
95L, 95L, 97L, 98L, 97L, 96L, 91L, 91L, 88L, 86L, 87L, 85L, 82L, 
79L, 76L, 63L, 60L, 59L, 58L, 58L, 50L, 42L, 43L, 36L, 36L, 33L, 
29L, 19L, 98L, 97L, 97L, 92L, 91L, 90L, 89L, 98L, 84L, 88L, 83L, 
80L, 79L, 79L, 78L, 76L), .Label = c("1920", "1921", "1922", 
"1924", "1925", "1926", "1927", "1928", "1930", "1931", "1932", 
"1933", "1934", "1935", "1936", "1937", "1938", "1939", "1940", 
"1941", "1942", "1943", "1944", "1945", "1946", "1947", "1948", 
"1949", "1950", "1951", "1952", "1953", "1954", "1955", "1956", 
"1957", "1958", "1959", "1960", "1961", "1962", "1963", "1964", 
"1965", "1966", "1967", "1968", "1969", "1970", "1971", "1972", 
"1973", "1974", "1975", "1976", "1977", "1978", "1979", "1980", 
"1981", "1982", "1983", "1984", "1985", "1986", "1987", "1988", 
"1989", "1990", "1991", "1992", "1993", "1994", "1995", "1996", 
"1997", "1998", "1999", "2000", "2001", "2002", "2003", "2004", 
"2005", "2006", "2007", "2008", "2009", "2010", "2011", "2012", 
"2013", "2014", "2015", "2016", "2017", "2018", "2019", "2020", 
"PG"), class = "factor"), Certificate = structure(c(3L, 3L, 16L, 
3L, 14L, 14L, 3L, 3L, 16L, 3L, 14L, 16L, 3L, 16L, 3L, 3L, 16L, 
3L, 9L, 3L, 14L, 16L, 3L, 14L, 10L, 3L, 14L, 3L, 3L, 16L, 1L, 
14L, 8L, 3L, 3L, 16L, 14L, 3L, 10L, 16L, 10L, 3L, 3L, 14L, 14L, 
14L, 14L, 14L, 14L, 3L, 14L, 5L, 5L, 3L, 1L, 16L, 14L, 14L, 14L, 
16L, 16L, 14L, 3L, 16L, 16L, 14L, 14L, 3L, 3L, 16L, 14L, 3L, 
3L, 3L, 10L, 10L, 14L, 1L, 3L, 14L, 3L, 14L, 7L, 7L, 10L, 3L, 
16L, 14L, 10L, 9L, 10L, 11L, 1L, 3L, 16L, 14L, 16L, 3L, 16L, 
14L), .Label = c("", "16", "A", "Approved", "G", "GP", "Passed", 
"PG", "PG-13", "R", "TV-14", "TV-MA", "TV-PG", "U", "U/A", "UA", 
"Unrated"), class = "factor"), Runtime = structure(c(43L, 75L, 
53L, 95L, 137L, 94L, 55L, 91L, 49L, 40L, 77L, 43L, 62L, 78L, 
37L, 47L, 25L, 34L, 61L, 33L, 54L, 70L, 31L, 26L, 70L, 86L, 17L, 
28L, 19L, 22L, 34L, 98L, 31L, 23L, 7L, 13L, 31L, 52L, 51L, 56L, 
20L, 7L, 11L, 129L, 38L, 56L, 130L, 17L, 66L, 10L, 3L, 128L, 
128L, 27L, 26L, 48L, 7L, 62L, 18L, 80L, 50L, 6L, 66L, 65L, 71L, 
66L, 139L, 38L, 2L, 14L, 35L, 105L, 16L, 47L, 48L, 18L, 23L, 
44L, 136L, 17L, 129L, 13L, 11L, 26L, 20L, 5L, 40L, 61L, 16L, 
24L, 32L, 33L, 13L, 54L, 9L, 23L, 5L, 3L, 23L, 27L), .Label = c("100 min", 
"101 min", "102 min", "103 min", "104 min", "105 min", "106 min", 
"107 min", "108 min", "109 min", "110 min", "111 min", "112 min", 
"113 min", "114 min", "115 min", "116 min", "117 min", "118 min", 
"119 min", "120 min", "121 min", "122 min", "123 min", "124 min", 
"125 min", "126 min", "127 min", "128 min", "129 min", "130 min", 
"131 min", "132 min", "133 min", "134 min", "135 min", "136 min", 
"137 min", "138 min", "139 min", "140 min", "141 min", "142 min", 
"143 min", "144 min", "145 min", "146 min", "147 min", "148 min", 
"149 min", "150 min", "151 min", "152 min", "153 min", "154 min", 
"155 min", "156 min", "157 min", "158 min", "159 min", "160 min", 
"161 min", "162 min", "163 min", "164 min", "165 min", "166 min", 
"167 min", "168 min", "169 min", "170 min", "171 min", "172 min", 
"174 min", "175 min", "177 min", "178 min", "179 min", "180 min", 
"181 min", "183 min", "184 min", "185 min", "186 min", "188 min", 
"189 min", "191 min", "192 min", "193 min", "194 min", "195 min", 
"196 min", "197 min", "201 min", "202 min", "204 min", "205 min", 
"207 min", "209 min", "210 min", "212 min", "220 min", "224 min", 
"228 min", "229 min", "238 min", "242 min", "321 min", "45 min", 
"64 min", "67 min", "68 min", "69 min", "70 min", "71 min", "72 min", 
"75 min", "76 min", "78 min", "79 min", "80 min", "81 min", "82 min", 
"83 min", "84 min", "85 min", "86 min", "87 min", "88 min", "89 min", 
"90 min", "91 min", "92 min", "93 min", "94 min", "95 min", "96 min", 
"97 min", "98 min", "99 min"), class = "factor"), Genre = structure(c(138L, 
123L, 23L, 123L, 123L, 5L, 123L, 88L, 12L, 138L, 5L, 173L, 202L, 
5L, 35L, 85L, 7L, 138L, 88L, 107L, 138L, 52L, 123L, 70L, 183L, 
124L, 106L, 130L, 133L, 7L, 28L, 5L, 140L, 133L, 163L, 84L, 170L, 
133L, 89L, 5L, 138L, 136L, 23L, 69L, 35L, 173L, 81L, 45L, 202L, 
195L, 176L, 102L, 106L, 138L, 88L, 23L, 79L, 17L, 63L, 5L, 12L, 
70L, 185L, 1L, 101L, 139L, 70L, 171L, 28L, 200L, 63L, 123L, 1L, 
159L, 172L, 196L, 167L, 130L, 94L, 130L, 183L, 200L, 150L, 108L, 
181L, 145L, 128L, 133L, 138L, 138L, 172L, 138L, 139L, 54L, 174L, 
120L, 95L, 138L, 138L, 173L), .Label = c("Action, Adventure", 
"Action, Adventure, Biography", "Action, Adventure, Comedy", 
"Action, Adventure, Crime", "Action, Adventure, Drama", "Action, Adventure, Family", 
"Action, Adventure, Fantasy", "Action, Adventure, History", "Action, Adventure, Horror", 
"Action, Adventure, Mystery", "Action, Adventure, Romance", "Action, Adventure, Sci-Fi", 
"Action, Adventure, Thriller", "Action, Adventure, War", "Action, Adventure, Western", 
"Action, Biography, Crime", "Action, Biography, Drama", "Action, Comedy, Crime", 
"Action, Comedy, Fantasy", "Action, Comedy, Mystery", "Action, Comedy, Romance", 
"Action, Crime, Comedy", "Action, Crime, Drama", "Action, Crime, Mystery", 
"Action, Crime, Thriller", "Action, Drama", "Action, Drama, History", 
"Action, Drama, Mystery", "Action, Drama, Sci-Fi", "Action, Drama, Sport", 
"Action, Drama, Thriller", "Action, Drama, War", "Action, Drama, Western", 
"Action, Mystery, Thriller", "Action, Sci-Fi", "Action, Sci-Fi, Thriller", 
"Action, Thriller", "Adventure, Biography, Crime", "Adventure, Biography, Drama", 
"Adventure, Comedy, Crime", "Adventure, Comedy, Drama", "Adventure, Comedy, Family", 
"Adventure, Comedy, Fantasy", "Adventure, Comedy, Film-Noir", 
"Adventure, Comedy, Sci-Fi", "Adventure, Comedy, War", "Adventure, Drama", 
"Adventure, Drama, Fantasy", "Adventure, Drama, History", "Adventure, Drama, Musical", 
"Adventure, Drama, Romance", "Adventure, Drama, Sci-Fi", "Adventure, Drama, Thriller", 
"Adventure, Drama, War", "Adventure, Drama, Western", "Adventure, Family, Fantasy", 
"Adventure, Fantasy", "Adventure, History, War", "Adventure, Horror, Sci-Fi", 
"Adventure, Mystery, Thriller", "Adventure, Sci-Fi", "Adventure, Thriller", 
"Animation, Action, Adventure", "Animation, Action, Crime", "Animation, Action, Drama", 
"Animation, Action, Fantasy", "Animation, Action, Sci-Fi", "Animation, Adventure, Comedy", 
"Animation, Adventure, Drama", "Animation, Adventure, Family", 
"Animation, Adventure, Fantasy", "Animation, Biography, Crime", 
"Animation, Biography, Drama", "Animation, Comedy, Crime", "Animation, Comedy, Drama", 
"Animation, Comedy, Fantasy", "Animation, Crime, Mystery", "Animation, Drama, Family", 
"Animation, Drama, Fantasy", "Animation, Drama, Romance", "Animation, Drama, War", 
"Animation, Family, Fantasy", "Animation, Sci-Fi", "Biography, Comedy, Drama", 
"Biography, Crime, Drama", "Biography, Drama", "Biography, Drama, Family", 
"Biography, Drama, History", "Biography, Drama, Music", "Biography, Drama, Romance", 
"Biography, Drama, Sport", "Biography, Drama, Thriller", "Biography, Drama, War", 
"Comedy", "Comedy, Crime", "Comedy, Crime, Drama", "Comedy, Crime, Mystery", 
"Comedy, Crime, Romance", "Comedy, Crime, Sport", "Comedy, Crime, Thriller", 
"Comedy, Drama", "Comedy, Drama, Family", "Comedy, Drama, Fantasy", 
"Comedy, Drama, Music", "Comedy, Drama, Musical", "Comedy, Drama, Romance", 
"Comedy, Drama, Thriller", "Comedy, Drama, War", "Comedy, Family", 
"Comedy, Family, Fantasy", "Comedy, Family, Romance", "Comedy, Fantasy, Romance", 
"Comedy, Horror", "Comedy, Music", "Comedy, Music, Musical", 
"Comedy, Music, Romance", "Comedy, Musical, Romance", "Comedy, Musical, War", 
"Comedy, Mystery, Romance", "Comedy, Romance", "Comedy, War", 
"Comedy, Western", "Crime, Drama", "Crime, Drama, Fantasy", "Crime, Drama, Film-Noir", 
"Crime, Drama, History", "Crime, Drama, Horror", "Crime, Drama, Music", 
"Crime, Drama, Musical", "Crime, Drama, Mystery", "Crime, Drama, Romance", 
"Crime, Drama, Sci-Fi", "Crime, Drama, Thriller", "Crime, Film-Noir, Mystery", 
"Crime, Film-Noir, Thriller", "Crime, Mystery, Thriller", "Crime, Thriller", 
"Drama", "Drama, Family", "Drama, Family, Fantasy", "Drama, Family, Musical", 
"Drama, Family, Sport", "Drama, Fantasy", "Drama, Fantasy, History", 
"Drama, Fantasy, Horror", "Drama, Fantasy, Music", "Drama, Fantasy, Mystery", 
"Drama, Fantasy, Romance", "Drama, Fantasy, War", "Drama, Film-Noir", 
"Drama, Film-Noir, Mystery", "Drama, Film-Noir, Romance", "Drama, History", 
"Drama, History, Music", "Drama, History, Mystery", "Drama, History, Romance", 
"Drama, History, Thriller", "Drama, History, War", "Drama, Horror", 
"Drama, Horror, Mystery", "Drama, Horror, Sci-Fi", "Drama, Horror, Thriller", 
"Drama, Music", "Drama, Music, Musical", "Drama, Music, Mystery", 
"Drama, Music, Romance", "Drama, Musical", "Drama, Mystery", 
"Drama, Mystery, Romance", "Drama, Mystery, Sci-Fi", "Drama, Mystery, Thriller", 
"Drama, Mystery, War", "Drama, Romance", "Drama, Romance, Sci-Fi", 
"Drama, Romance, Thriller", "Drama, Romance, War", "Drama, Sci-Fi", 
"Drama, Sci-Fi, Thriller", "Drama, Sport", "Drama, Thriller", 
"Drama, Thriller, War", "Drama, Thriller, Western", "Drama, War", 
"Drama, War, Western", "Drama, Western", "Family, Fantasy, Musical", 
"Family, Sci-Fi", "Fantasy, Horror", "Fantasy, Horror, Mystery", 
"Film-Noir, Mystery", "Film-Noir, Mystery, Thriller", "Film-Noir, Thriller", 
"Horror", "Horror, Mystery, Sci-Fi", "Horror, Mystery, Thriller", 
"Horror, Sci-Fi", "Horror, Thriller", "Mystery, Romance, Thriller", 
"Mystery, Sci-Fi, Thriller", "Mystery, Thriller", "Thriller", 
"Western"), class = "factor"), IMDB_Rating = c(9.3, 9.2, 9, 9, 
9, 8.9, 8.9, 8.9, 8.8, 8.8, 8.8, 8.8, 8.8, 8.7, 8.7, 8.7, 8.7, 
8.7, 8.6, 8.6, 8.6, 8.6, 8.6, 8.6, 8.6, 8.6, 8.6, 8.6, 8.6, 8.6, 
8.6, 8.6, 8.6, 8.5, 8.5, 8.5, 8.5, 8.5, 8.5, 8.5, 8.5, 8.5, 8.5, 
8.5, 8.5, 8.5, 8.5, 8.5, 8.5, 8.5, 8.5, 8.5, 8.5, 8.4, 8.4, 8.4, 
8.4, 8.4, 8.4, 8.4, 8.4, 8.4, 8.4, 8.4, 8.4, 8.4, 8.4, 8.4, 8.4, 
8.4, 8.4, 8.4, 8.4, 8.4, 8.4, 8.4, 8.4, 8.4, 8.4, 8.4, 8.4, 8.4, 
8.4, 8.4, 8.3, 8.3, 8.3, 8.3, 8.3, 8.3, 8.3, 8.3, 8.3, 8.3, 8.3, 
8.3, 8.3, 8.3, 8.3, 8.3), Meta_score = c(80L, 100L, 84L, 90L, 
96L, 94L, 94L, 94L, 74L, 66L, 92L, 82L, 90L, 87L, 73L, 90L, 82L, 
83L, 90L, 96L, NA, 74L, 79L, 96L, 91L, 61L, 59L, 65L, 85L, 90L, 
85L, 98L, 89L, 59L, 88L, 57L, 66L, 85L, 85L, 67L, 62L, 77L, 64L, 
88L, 75L, 80L, 94L, 87L, 80L, 97L, 100L, 96L, 99L, 75L, NA, NA, 
79L, NA, 87L, 78L, 68L, 81L, 81L, 78L, 67L, NA, 95L, 89L, 77L, 
80L, 76L, NA, 85L, 66L, 94L, 89L, NA, NA, 97L, NA, 90L, 100L, 
NA, NA, 78L, NA, NA, NA, 77L, 95L, 80L, NA, NA, 69L, 89L, 69L, 
55L, 68L, 84L, 70L), No_of_Votes = c(2343110L, 1620367L, 2303232L, 
1129952L, 689845L, 1642758L, 1826188L, 1213505L, 2067042L, 1854740L, 
1661481L, 1809221L, 688390L, 1485555L, 1676426L, 1020727L, 1159315L, 
918088L, 55291L, 552778L, 54995L, 1512360L, 699256L, 651376L, 
1235804L, 1147794L, 623629L, 1445096L, 1270197L, 1231473L, 42004L, 
315744L, 405801L, 939252L, 717585L, 760360L, 1190259L, 1189773L, 
729603L, 1341460L, 1034705L, 991208L, 1035236L, 942045L, 995506L, 
230763L, 235231L, 1058081L, 302844L, 604211L, 522093L, 217881L, 
167839L, 62635L, 34112L, 28401L, 194838L, 156479L, 375110L, 809955L, 
834477L, 384171L, 1357682L, 1516346L, 344445L, 168895L, 999790L, 
358685L, 515451L, 1125712L, 343171L, 311365L, 884112L, 898237L, 
606398L, 787806L, 30273L, 34357L, 450474L, 108862L, 178092L, 
444074L, 201632L, 203150L, 425844L, 27793L, 71875L, 30722L, 281623L, 
220002L, 150023L, 33935L, 78925L, 1267869L, 911664L, 703810L, 
782001L, 766870L, 1069738L, 861606L), Gross = structure(c(386L, 
152L, 636L, 664L, 518L, 493L, 88L, 820L, 399L, 489L, 442L, 461L, 
673L, 472L, 219L, 571L, 398L, 101L, 1L, 632L, 1L, 240L, 723L, 
55L, 308L, 154L, 667L, 71L, 146L, 454L, 1L, 378L, 1L, 464L, 132L, 
134L, 630L, 150L, 452L, 239L, 683L, 330L, 246L, 544L, 293L, 97L, 
1L, 304L, 593L, 445L, 5L, 195L, 244L, 43L, 1L, 1L, 586L, 115L, 
248L, 789L, 709L, 298L, 193L, 558L, 681L, 21L, 323L, 92L, 735L, 
357L, 271L, 593L, 349L, 551L, 781L, 764L, 1L, 1L, 383L, 769L, 
1L, 485L, 1L, 392L, 185L, 1L, 29L, 1L, 711L, 718L, 688L, 1L, 
1L, 119L, 467L, 458L, 429L, 421L, 144L, 155L), .Label = c("", 
"1,000,045", "1,008,098", "1,010,414", "1,024,560", "1,033,895", 
"1,035,953", "1,037,847", "1,054,361", "1,059,830", "1,079,369", 
"1,082,715", "1,092,800", "1,105,564", "1,111,061", "1,113,541", 
"1,122,527", "1,185,783", "1,221,261", "1,223,240", "1,223,869", 
"1,229,197", "1,236,166", "1,241,223", "1,305", "1,324,974", 
"1,330,596", "1,339,152", "1,373,943", "1,378,435", "1,429,534", 
"1,436,000", "1,464,625", "1,480,006", "1,498,210", "1,506,975", 
"1,526,000", "1,530,386", "1,544,889", "1,585,634", "1,626,289", 
"1,647,780", "1,661,096", "1,670,773", "1,742,348", "1,752,214", 
"1,769,305", "1,782,795", "1,787,378", "1,794,187", "1,924,733", 
"1,999,955", "10,000,000", "10,019,307", "10,055,859", "10,095,170", 
"10,177", "10,301,706", "10,464,000", "10,550,000", "10,600,000", 
"10,616,104", "10,631,333", "10,680,275", "10,725,228", "10,824,921", 
"10,900,000", "10,950", "100,012,499", "100,119", "100,125,643", 
"100,206,256", "100,492,203", "100,546,139", "101,157,447", "102,021", 
"102,272,727", "102,308,889", "102,515,793", "104,454,762", "104,945,305", 
"106,260,000", "106,662", "106,954,678", "107,100,855", "107,509,799", 
"107,825,862", "107,928,762", "108,101,214", "108,638,745", "109,767,581", 
"11,286,112", "11,403,529", "11,487,676", "11,798,616", "11,900,000", 
"11,990,401", "111,110,575", "111,543,479", "111,722,000", "112,000,000", 
"115,646,235", "115,654,751", "116,900,694", "117,235,247", "117,624,028", 
"118,500,000", "119,285,432", "119,500,000", "119,519,402", "12,064,472", 
"12,100,000", "12,281,500", "12,339,633", "12,391,761", "12,465,371", 
"12,535,000", "12,562", "120,540,719", "120,620,254", "121,661,683", 
"124,872,350", "124,987,023", "125,618,201", "127,509,326", "128,012,934", 
"128,078,872", "128,261,724", "128,392", "128,985", "13,060,843", 
"13,092,000", "13,122,642", "13,182,281", "13,275,000", "13,417,292", 
"13,474,588", "13,542,874", "13,622,333", "13,657,115", "13,756,082", 
"13,780,024", "13,782,838", "130,096,601", "130,164,645", "130,742,922", 
"132,072,926", "132,088,635", "132,092,958", "132,384,315", "132,422,809", 
"134,966,411", "136,025,503", "136,801,374", "138,433,435", "138,530,565", 
"138,730", "138,797,449", "14,131", "14,378,331", "14,500,000", 
"14,677,674", "14,743,391", "141,072", "141,319,928", "141,340,178", 
"141,843,612", "142,502,728", "144,501", "145,000,989", "146,408,305", 
"148,095,302", "148,478,011", "15,000,000", "15,070,285", "15,090,400", 
"15,280", "15,322,921", "15,539,266", "15,630,710", "151,086", 
"151,101,803", "154,058,340", "156,452,370", "159,227,644", "159,600,000", 
"16,056,255", "16,217,773", "16,290,476", "16,501,785", "16,756,372", 
"161,197,785", "162,805,434", "163,214,286", "163,245", "163,566,459", 
"164,615,351", "165,359,751", "165,520", "167,445,960", "167,767,189", 
"169,209", "169,607,287", "169,659", "169,708,112", "17,105,219", 
"17,108,591", "17,114,882", "17,266,971", "17,498,804", "17,550,741", 
"17,570,324", "17,605,861", "17,654,912", "17,738,570", "170,742,341", 
"171,082", "171,243,005", "171,479,930", "172,885", "173,837,933", 
"175,058", "176,040,665", "176,241,941", "177,002,924", "177,345", 
"178,800,000", "18,095,701", "18,254,702", "18,340,051", "18,354,356", 
"18,593,156", "18,600,000", "181,655", "183,417,150", "183,637,894", 
"183,875,760", "184,208,848", "187,705,427", "188,020,017", "188,373,161", 
"188,751", "189,422,889", "19,181", "19,202,743", "19,501,238", 
"19,516,000", "190,241,310", "191,796,233", "193,817", "197,171,806", 
"198,676,459", "198,809", "2,000,000", "2,006,788", "2,015,810", 
"2,076,020", "2,084,637", "2,086,345", "2,108,060", "2,122,065", 
"2,150,000", "2,181,987", "2,197,331", "2,199,675", "2,201,126", 
"2,217,561", "2,222,647", "2,237,659", "2,280,348", "2,375,308", 
"2,380,788", "2,402,067", "2,500,000", "2,537,520", "2,603,061", 
"2,616,000", "2,625,803", "2,650,000", "2,734,044", "2,804,874", 
"2,807,390", "2,832,029", "2,852,400", "2,892,011", "2,921,738", 
"20,045,115", "20,186,659", "20,300,218", "20,605,209", "200,821,936", 
"203,300", "204,843,350", "206,445,654", "206,852,432", "208,545,589", 
"209,028,679", "209,726,015", "21,002,919", "21,500,000", "21,848,932", 
"21,877", "21,995,263", "210,609,762", "210,614,939", "215,288,866", 
"216,428,042", "216,540,909", "217,350,219", "217,581,231", "218,967,620", 
"22,238,696", "22,244,207", "22,245,861", "22,276,975", "22,455,976", 
"22,490,039", "22,494,487", "22,858,926", "22,954,968", "220,159,104", 
"222,527,828", "223,808,164", "226,277,068", "227,471,070", "228,433,663", 
"228,778,661", "23,089,926", "23,159,305", "23,341,568", "23,383,987", 
"23,530,892", "23,637,265", "23,650,000", "232,906,145", "233,632,142", 
"233,921,534", "233,986", "234,723", "238,507", "238,632,124", 
"24,149,632", "24,379,978", "24,475,416", "24,611,975", "24,633,730", 
"24,801,212", "245,852,179", "248,159,971", "248,757,044", "249,358,727", 
"25,000,000", "25,010,410", "25,379,975", "25,442,958", "25,514,517", 
"25,544,867", "25,568,251", "25,812", "251,513,985", "255,959,475", 
"257,730,019", "257,760,692", "258,168", "258,366,855", "259,127", 
"259,766,572", "26,020,957", "26,236,603", "26,331", "26,400,640", 
"26,830,000", "26,862,450", "26,947,624", "260,000,000", "261,441,092", 
"267,665,011", "269,061", "27,281,507", "27,298,285", "27,545,445", 
"274,092,705", "275,902", "277,322,503", "28,262,574", "28,341,469", 
"28,350,000", "28,877", "28,965,197", "280,015", "285,761,243", 
"288,475", "289,916,256", "29,000,000", "29,133,000", "29,800,000", 
"290,013,036", "290,475,067", "292,576,195", "293,004,164", "293,506,292", 
"295,983,305", "296,000", "3,029,081", "3,081,925", "3,107,072", 
"3,108,485", "3,151,130", "3,185,812", "3,200,000", "3,237,118", 
"3,270,000", "3,296", "3,313,513", "3,333,000", "3,333,969", 
"3,358,518", "3,492,754", "3,600", "3,635,164", "3,635,482", 
"3,759,854", "3,796,699", "3,897,569", "3,969,893", "3,981,000", 
"30,000,000", "30,177,511", "30,328,156", "30,500,000", "30,857,814", 
"30,933,743", "300,000", "301,959,197", "303,003,568", "304,360,277", 
"305,413,918", "309,125,409", "309,811", "31,800,000", "315,058,289", 
"315,544,750", "317,575,550", "318,412,101", "32,000,000", "32,015,231", 
"32,381,218", "32,391,374", "32,416,586", "32,481,825", "32,534,850", 
"32,572,577", "32,868,943", "322,740,140", "324,591,735", "327,919", 
"33,080,084", "33,225,499", "33,395,426", "33,800,859", "330,252,182", 
"332,930", "333,176,600", "335,451,311", "335,609", "336,705", 
"34,400,301", "34,603,943", "34,700,291", "341,268,248", "342,370", 
"342,551,365", "348,660", "349,555", "35,000,000", "35,014,192", 
"35,061,555", "35,552,383", "35,739,802", "35,811,509", "35,893,537", 
"35,900,000", "356,461,711", "36,400,491", "36,764,313", "36,948,322", 
"363,070,709", "368,234", "37,030,102", "37,634,615", "37,707,719", 
"37,823,676", "377,845,905", "38,400,000", "38,405,088", "38,634,938", 
"380,843,261", "381,011,219", "389,813,101", "39,100,000", "39,200,000", 
"39,481", "39,567", "39,868,642", "4,000,000", "4,018,695", "4,040,691", 
"4,043,686", "4,050,000", "4,064,200", "4,065,116", "4,081,254", 
"4,105,123", "4,135,750", "4,184,036", "4,186,168", "4,231,500", 
"4,360,000", "4,398,392", "4,414,535", "4,420,000", "4,445,756", 
"4,496,583", "4,542,825", "4,711,096", "4,890,878", "4,905,000", 
"4,971,340", "40,084,041", "40,222,514", "40,311,852", "40,442,052", 
"40,903,593", "402,453,882", "408,084,349", "41,003,371", "41,909,762", 
"410,800", "412,544", "415,004,880", "42,340,598", "42,438,300", 
"42,765,000", "422,783,777", "43,000,000", "43,182,776", "43,984,230", 
"434,038,008", "435,110,554", "435,266", "44,017,374", "44,527,234", 
"44,585,453", "44,671,682", "44,785,053", "44,824,144", "44,908,000", 
"448,139,099", "449,191", "45,055,776", "45,064,915", "45,289", 
"45,300,000", "45,512,466", "45,512,588", "45,598,982", "45,700,000", 
"45,875,171", "453,243", "46,357,676", "46,836,394", "46,889,293", 
"47,000,000", "47,212,904", "47,695,120", "48,023,088", "48,071,303", 
"48,169,908", "48,323,648", "48,979,328", "49,100,000", "49,530,280", 
"495,770", "5,009,677", "5,014,000", "5,017,246", "5,080,409", 
"5,100,000", "5,128,124", "5,202,582", "5,209,580", "5,216,888", 
"5,321,508", "5,383,834", "5,450,000", "5,509,040", "5,535,405", 
"5,566,534", "5,595,428", "5,617,391", "5,720,000", "5,739,376", 
"5,820,649", "5,875,006", "5,887,457", "5,904,366", "5,923,044", 
"5,990,075", "50,000,000", "50,668,906", "50,690", "50,866,635", 
"50,927,067", "50,970", "502,028", "51,081,062", "51,401,758", 
"51,680,613", "51,739,495", "51,973,029", "515,905", "52,037,603", 
"52,096,475", "52,287,414", "52,364,010", "52,709", "52,767,889", 
"52,929,168", "52,990,775", "53,089,891", "53,267,000", "53,367,844", 
"53,606,916", "53,710,019", "532,177,324", "534,858,444", "536,118", 
"539,540", "54,000,000", "54,117,416", "54,234,062", "54,513,740", 
"54,580,300", "54,800,000", "541,940", "547,292", "548,707", 
"55,000", "55,240", "55,908", "553,171", "56,000,369", "56,116,183", 
"56,362,352", "56,505,065", "56,671,993", "56,700,000", "56,816,662", 
"56,954,992", "566,356", "57,141,459", "57,226", "57,229,890", 
"57,300,000", "57,366,262", "57,504,069", "57,598,247", "57,938,693", 
"59,100,318", "59,735,548", "59,891,098", "6,013", "6,100,000", 
"6,110,979", "6,153,939", "6,167,817", "6,203,044", "6,207,725", 
"6,391,436", "6,460", "6,532,908", "6,540,000", "6,719,864", 
"6,735,118", "6,738,000", "6,739,492", "6,743,776", "6,857,096", 
"600,200", "608,581,744", "61,001", "61,002,302", "61,276,872", 
"61,503,218", "61,649,911", "61,700,000", "623,279,547", "63,540,020", 
"63,895,607", "64,616,940", "65,207,127", "654,000", "659,325,379", 
"66,208,183", "66,257,002", "66,666,062", "67,209,615", "67,436,818", 
"678,815,482", "686,383", "687,185", "69,951,824", "696,690", 
"697,181", "7,000,000", "7,002,255", "7,056,013", "7,098,492", 
"7,153,487", "7,220,243", "7,267,585", "7,461", "7,563,397", 
"7,630,000", "7,757,130", "7,993,039", "70,099,045", "70,136,369", 
"70,147", "70,259,870", "70,405,498", "70,511,035", "70,600,000", 
"70,906,973", "707,481", "71,177", "71,516,617", "72,000,000", 
"72,313,754", "733,094", "739,478", "74,103,820", "74,283,625", 
"74,700,000", "741,283", "75,082,668", "75,286,229", "75,331,600", 
"75,505,856", "75,590,286", "75,600,000", "75,605,492", "752,045", 
"76,270,454", "76,408,097", "76,631,907", "76,657,000", "760,507,625", 
"765,127", "77,324,422", "77,911,774", "776,665", "78,756,177", 
"78,900,000", "78,912,963", "8,000,000", "8,060", "8,114,627", 
"8,175,000", "8,178,001", "8,264,530", "8,284,000", "8,551,228", 
"8,819,028", "80,500,000", "81,001,787", "82,418,501", "83,008,852", 
"83,043,761", "83,400,000", "83,471,511", "83,861", "83,957", 
"845,464", "85,080,171", "85,160,248", "85,433", "857,524", "858,373,000", 
"86,300,000", "871,577", "88,300", "88,513,495", "881,302", "89,029", 
"898,575", "9,030,581", "9,170,214", "9,284,265", "9,422,422", 
"9,439,923", "9,450,000", "9,460,000", "9,600,000", "9,929,135", 
"90,135,191", "901,610", "91,125,683", "92,054,159", "92,823,600", 
"923,221", "93,617,009", "93,740,000", "933,933", "936,662,225", 
"95,860,116", "959,000", "96,522,687", "96,568", "96,898,818", 
"96,962,694", "977,375", "98,467,863", "985,912"), class = "factor")), row.names = c(NA, 
100L), class = "data.frame")

Now, If I am using colSums or naniar to compute or visualize the missing values, it is only showing those of Meta_score variable. Others aren't been displayed. What is the issue here? How Can I resolve it?


Solution

  • Since there is a tidyverse tag:

    Here is a dplyr approach to replacing empty values with NA. Replace df with the name of your dataset. Note that I included the summarise statement to sum the NA values to show that they are now present and accounted for in the other variables.

    
    library(dplyr)
    
    df %>% 
      mutate(across(everything(), ~na_if(.x, ""))) %>% 
      summarise(across(everything(), ~sum(is.na(.x))))
    
    #>   Released_Year Certificate Runtime Genre IMDB_Rating Meta_score No_of_Votes
    #> 1             0           4       0     0           0         16           0
    #>   Gross
    #> 1    15
    

    Created on 2021-03-23 by the reprex package (v0.3.0)