I have a dataframe of 1000 rows. The code I want to loop through is very simple - I just want to make all the values in column 4 uppercase. I want it such that if there is an error in any of the rows, I want it to skip that row and continue to the rest of the rows.
I've written this code:
for(i in 1:1000)
{
tryCatch(toupper(Total_Data_2[i,4]), error = function(e) next)
}
However, I get the error: Error in value[[3L]](cond) : no loop for break/next, jumping to top level
Can someone help me with this? I could do a tryCatch or some sort of if iserror.
Thanks in advance!!
Total_Data_2[, 4] = toupper(Total_Data_2[, 4]), no need for a loop.stringiprobably does. TryTotal_Data_2[, 4] = stringi::stri_trans_toupper(Total_Data_2[, 4])