I was asked to import a csv file in R and to insert lines for 2 people with the sex and date of birth.
Existing dataframe:
Sex BirthDate
1 05/10/1952
1 14/06/2004
2 21/11/1963
In the existing dataframe date of birth is in class "factor".
class(BirthDate)
[1] "factor"
I need to insert:
person 1 : 2, 20/10/1980
person 2 : 1, 21/02/1970
I tried:
b1 <- rbind(
dataf1,
c("2", as.factor("20/10/1980")),
c("1", as.factor("21/02/1970"))
)
but I have NA in BirthDate
How to insert dates without changing the existing dataframe?