TROUBLING with the "DROP_NA" Function

56 Views Asked by At

I have a problem with drop_na() function. I wanted to clean the dataset and erase the "NA" values, but when I entered the code, all datas are disseapperad. I do not understand why it happens. You can see clearly what my codes are in this picture:

enter image description here

library(tidyverse)
WDI_GNI<read_csv("C:/Users/sudes/Downloads/P_Data_Extract_From_World_Development_Indicators/a7b778c6-9827-4c45-91b7-8f497087ca17_Data.csv")WDI_GNI <- WDI_GNI %>%
  mutate(across(contains("[YR"),~na_if(.x, ".."))) %>%
  mutate(across(contains("[YR"), as.numeric))
WDI_GNI <- drop_na(WDI_GNI)
0

There are 0 best solutions below