I'd like to remove the last character of a string if there is any letter at the end of it.
sample vector is:
string <- c("L_3_A_L_3_1b", "L_3_A_L_3_1e", "L_3_A_L_3_1h", "RL_3_C_RL_3_9", "SL_3_A_SL_3_2")
I'd like to drop the last letter as:
> string
[1] "L_3_A_L_3_1" "L_3_A_L_3_1" "L_3_A_L_3_1" "RL_3_C_RL_3_9" "SL_3_A_SL_3_2"
ANy thoughts? Thanks!