So, for example, taking a simplified data frame consisting of single numeric variable
set.seed(42)
dat <- data.frame(score = sample(1:100,100,replace = TRUE))
dat$category <- ifelse(dat$score < median(dat$score),0,1)
head(dat)
#> score category
#> 1 49 1
#> 2 65 1
#> 3 25 0
#> 4 74 1
#> 5 100 1
#> 6 18 0