The following is an example: | Item_Identifier | Item_Weight | | FDP10 | 19 | | FDP10 | | | DRI11 | 8.26 | | DRI11 | | | FDW12 | 8.315 | | FDW12 | |
The following is the one that i want to be. That is, filling NA values from the previous Non-NA values. | Item_Identifier | Item_Weight | | FDP10 | 19 | | FDP10 | 19 | | DRI11 | 8.26 | | DRI11 | 8.26 | | FDW12 | 8.315 | | FDW12 | 8.315 | My current code data frame: train <- read.csv("Train.csv", header=T,sep = ",",na.strings = c(""," ",NA)) Some people suggest to use na.locf function but in my case, i don't have numeric unique values in my Item_Identifier coloumn but rather it's characters. Not sure what to solve this problem. [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.