Use tidyverse stringr.
pacman::p_load(tidyverse, stringr)
>str_sub("string12345", end=-3)
[1] "string123"
If the csv reads into a tibble (data frame),
Let it flow down the pipe like this:
pacman::p_load(tidyverse, stringr)
tibble<-read_csv("file.csv")
tumble%>%
mute(kugiri_kekka<-str_sub(kuguritai, end=-3))
© 2024 OneMinuteCode. All rights reserved.