Lets say I have the following data frame.

df = data.frame(word = c("David", "James", "Sara", "Jamie", "Jon"))
df

I was trying to place brackets , [ ] , around each string.

I'll be exporting it with write.table and quotes=FALSE, so it will
eventually look like:

[David]
[James]
[Sara]
....


Can anyone help with this task?

I'd like to avoid regular expressions, but I haven't been able to use the
paste function
to get the desired result.

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to