Skip to content

How do I separate elements of a vector by comma?

3 messages · Patty Haaem, arun, John Kane

#
Hi,
Try:
vec1#vector

paste(vec1,collapse=",")
A.K.
On Sunday, December 22, 2013 10:42 AM, Patty Haaem <elham_h763 at yahoo.com> wrote:
I have a vector like this (this vector is a colomn of a data set):
I want to separate elements of?the vector by comma like this:
How can do this?
Thanks.
Elham
??? [[alternative HTML version deleted]]

______________________________________________
R-help at 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.
#
paste(xx,",", sep = "") but this coerces the vector to a character vector.

John Kane
Kingston ON Canada
____________________________________________________________
FREE ONLINE PHOTOSHARING - Share your photos online with your friends and family!
Visit http://www.inbox.com/photosharing to find out more!