Hi I am trying to set all non-NA values to 1 in a column of my dataset. Here is some sample data:
structure(list(ID = c(1, 1, 1, 1, 2, 3, 4, 4), match = structure(c(NA,
10227, 10227, 10957, NA, 11323, NA, 11323), class = "Date"),
actual.date = structure(c(10135, 10258, 11808, 11808, 10773,
13027, 13269, 12086), class = "Date")), .Names = c("ID",
"match", "actual.date"), row.names = c(NA, -8L), class = "data.frame")
ID match actual.date
1 1 <NA> 1997-10-01
2 1 1998-01-01 1998-02-01
3 1 1998-01-01 2002-05-01
4 1 2000-01-01 2002-05-01
5 2 <NA> 1999-07-01
6 3 2001-01-01 2005-09-01
7 4 <NA> 2006-05-01
8 4 2001-01-01 2003-02-03
For the 'match' column I want to set all non-NA's equal to 1.