You can paste the strings together into one with paste(). Then you can use gsub() to remove all spaces:
gsub(" ", "", paste(a, b))
# [1] "bigearthsmallmoon"
You can paste the strings together into one with paste(). Then you can use gsub() to remove all spaces:
gsub(" ", "", paste(a, b))
# [1] "bigearthsmallmoon"