Here is one way to extract the numbers, which says to extract a group of numbers ranging in length from 2-digits to 10-digits.
library(tidyverse)
# sample data
df = data.frame(
truck_id = paste0('truck ', 1:5),
from = c('CHORILLO', 'CHORILLO', '',
'shift 1 with 0 time left, 194.0 to thrash',
'truck is running shift 3, today generated 6877 kg')
)
# add "new" column for numbers
out = df %>%
mutate(shift = str_extract(from,'shift [0-9]'),
new = str_extract(from, '[0-9]{2,10}'))
out
#> truck_id from shift new
#> 1 truck 1 CHORILLO <NA> <NA>
#> 2 truck 2 CHORILLO <NA> <NA>
#> 3 truck 3 <NA> <NA>
#> 4 truck 4 shift 1 with 0 time left, 194.0 to thrash shift 1 194
#> 5 truck 5 truck is running shift 3, today generated 6877 kg shift 3 6877
Created on 2023-01-12 with reprex v2.0.2.9000