Filtering Out NA in Column

How do I create a column that is the copy of another column but with all NA's filtered out? I want to analyze that column while maintaining the rows that hold NA's in that column because they data in other columns.

Hi, welcome to the forum.

If I understand the question you wish to independently analyse the data in one column of a data.frame with the NA's removed. I think this example does what you want

dat1 <-   data.frame(xx = 1:10, yy = c(1,2,3,4,NA, 6,7,8,9,NA))
 dat2 <-    na.omit(dat1$yy)

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.