Here's a hack solution - there is likely a better way:
library(dplyr)
df <- data.frame(Value = c("I240", "G460", "1560", "S50"))
df %>%
mutate(temp = substr(Value,1,1),
temp = is.na(as.numeric(as.character(temp))),
Value = ifelse(temp == TRUE, substr(Value,1,3), Value)) %>%
select(-temp)
This gives us:
Value
1 I24
2 G46
3 1560
4 S50
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…