How to add a space in a variable in Rstudio

I want to add a space between the following variables in order to get this result:
2045 John Craine.
I would ask for your help since I can't find a way to do this in RStudio.

image

Enclose in backticks:

space_cadet <- `Air Head`

Better yet, use legal names in the data frame and adjust in the presentation table.

Hi @dcv8300, you need something like that ?

Status<- c('2045John Craine','2046Mary Craine')

gsub(Status, pattern = "(.{4})(.*)", replacement = "\\1 \\2")

# "2045 John Craine" "2046 Mary Craine"

Thank you for your help :smile: