I'm trying to replace a cell of a data frame, which I generated earlier in my code, with another text.
for (i in 1:length(flatfileFltrd)){
rename = paste("WEN", "\\", flatfileFltrd[i,8], sep = "")
flatfileFltrd$fileName[i] = rename
}
which returns:
In `[<-.factor`(`*tmp*`, i, value = "WEN\\UA") :
invalid factor level, NA generated
I tried to figure out what type of a data frame I have as I'm assuming the problem goes back that as they're not both the same but no luck. is.atomic(flatfileFltrd$fileName[i]) returns TRUE
How do I fix this? is there a better way to replace my data elements?