list:
number name age status
1 ben 34 m
2 max 12 s
3 27 s
4 42 d
I have this list and I have tried to replace the empty parts in "name" coulm.
this is my code (all my tries):
list$name[3] <- "eric"
list[3,2] <- "eric"
list[3,2] <- 0
list[is.na(list)] <- 0
this is the error:
Warning message:
In `[<-.factor`(`*tmp*`, 3, value = c(2L, 3L, NA, NA, 1L, 1L, 1L, :
invalid factor level, NA generated
Warning message:
In `[<-.factor`(`*tmp*`, thisvar, value = 0) :
invalid factor level, NA generated
do you know what's the problem?