seperate words in column r

# Sample data frame with a column named 'text'
df <- data.frame(text = c("Hello World", "Data Science", "R Programming"))

# Split the words in the 'text' column using the strsplit function
df$words <- sapply(strsplit(as.character(df$text), " "), function(x) paste(x, collapse = ","))

# Display the resulting data frame
df