I have words, Genus species, and I want an underscore to replace the space between the two strings in R
Input:
>data$species Genus species
You should use gsub:
gsub
data$species <- gsub(" ", "_", data$species)