Here are two ways to separate the info column into its components.
TEXT <- c("1-john-80-math-4q19", "2-linda-90-art-4q10")
DF <- data.frame(OtherCol = c(23, 45), info = TEXT)
DF
#> OtherCol info
#> 1 23 1-john-80-math-4q19
#> 2 45 2-linda-90-art-4q10
library(stringr)
TextMat <- str_split(DF$info,"-", simplify = TRUE)
DF$Subject <- TextMat[, 4]
DF
#> OtherCol info Subject
#> 1 23 1-john-80-math-4q19 math
#> 2 45 2-linda-90-art-4q10 art
#with tidyr
library(tidyr)
DF <- data.frame(OtherCol = c(23, 45), info = TEXT)
DF <- separate(DF, info, into = c("ID", "name", "score", "subject", "quarter"), sep = "-")
DF
#> OtherCol ID name score subject quarter
#> 1 23 1 john 80 math 4q19
#> 2 45 2 linda 90 art 4q10
Created on 2020-09-23 by the reprex package (v0.3.0)