I am having trouble with data frames in R. I create the data frame with defined datatypes but when I append data it changes the data type. I don't understand why this is happening or the find a solution. Can anyone help?
df<- data.frame(year=integer(), yes_no=character())
df[nrow(df) + 1,] = c(2022 ,"Y")