r - Display only one line for each NA Value -
At some point in my script, I want to see the number of incorrect values
in my Data.frame
and display them. In my case I have:
outside & lt; - read.csv (file = "..... / OUT.csv", na.strings = "NULL") is yoga (outside $ codeHelper)) [is.na (out $ codeHelper), c ( 1, Length (colnames (outside)))
It works perfectly well. However, the last command clearly gives me the full data.frame
where NA
is TRUE
, such as:
< Code> 5561 Yemen (PDR) and lieutenant; NA & gt; 5562 Yemen (PDR) & lieutenant; NA & gt; 5563 Yemen (PDR) & lieutenant; NA & gt; 5564 Yemen (PDR) & lieutenant; NA & gt; 5565 Yemen (PDR) and lieutenant; NA & gt; 5566 Yemen (PDR) & lieutenant; NA & gt; 5567 Yemen (PDR) and lieutenant; NA & gt; 5568 Yemen (PDR) & lieutenant; NA & gt; 5601 Zaire (Democ Rep Congo) & lt; NA & gt; 5602 Zaire (Democ Rep Congo) & lt; NA & gt; 5603 Zaire (Democratic Republic of Congo) & lt; NA & gt; 5604 Zaire (Democ Rep Congo) & lt; NA & gt; 5605 Zaire (Democ Rep Congo) & lt; NA & gt;
With a big frame and many NAS which looks very dirty. Important to me is that where the NA is, the country (in the second column) is missing the value in the third column.
So how can I show a line for each country only?
It should look something like this:
1 Yemen (PDR) & lt; NA & gt; 2 Zaire (Democ Rep Congo) & lt; NA & gt; 3 USA & lt; NA & gt; 4 W Samoa & Lt; NA & gt;
unique (c (1,2,3,4,4) )
You
1 2 3 4
such
unique (Outside [is.na (out $ codeHelper), c (1, length (colnames (outside)))))
What should you be looking for?
Comments
Post a Comment