I have this data frame:
bloqueados$HoraLlamada<- as.character(c(83048, 163112, 115929, 123632, 114541, 72807 163626, 130051, 81645, 121639))
If their the name of characters of each row is 5 I need to add a "0" at the beginning of the string. I am trying these code, but it is adding a "0" to every row:
for (i in bloqueados$HoraLlamada){
if(nchar(bloqueados$HoraLlamada)==5){
bloqueados$HoraLlamada2<- paste("0",bloqueados$HoraLlamada)
}else{
bloqueados$HoraLlamada2<-paste(bloqueados$HoraLlamada)
}
}