Re: [R] string concatenation

2020-11-05 Thread Jiefei Wang
Hi, Thanks for clarifying, there is no quote in the result. The quote in the output is just R's way to tell you that the variable got printed is a string. If you add quotes around a string, it will get printed like "\"Alice, Bob, Charles\"" I hope this helps. Best, Jiefei On Thu, Nov 5, 2020 a

Re: [R] string concatenation

2020-11-05 Thread Duncan Murdoch
On 05/11/2020 3:20 a.m., Edjabou Vincent wrote: Following John request, I am wondering if it is possible to get this result: Alice, Bob, Charles (without bracket ) I think you mean "without the quotes". Use noquote(): noquote(paste0(x,collapse = ", ")) will print without quotes. (Interna

Re: [R] string concatenation

2020-11-05 Thread Edjabou Vincent
Following John request, I am wondering if it is possible to get this result: Alice, Bob, Charles (without bracket ) Thank you for your help Med venlig hilsen/ Best regards Vincent Edjabou Mobile: +45 31 95 99 33 linkedin.com/vincent O

Re: [R] string concatenation

2020-11-04 Thread Jiefei Wang
Hi John, Try paste0(x,collapse = ", ") Best, Jiefei On Thu, Nov 5, 2020 at 1:16 PM John wrote: > Hi, > > I have a sequence of characters: > > x <- c("Alice", "Bob", "Charles") > > How can I produce the following results: > > "Alice, Bob, Charles" > > ? > > paste? merge? > > Thank you very much

[R] string concatenation

2020-11-04 Thread John
Hi, I have a sequence of characters: x <- c("Alice", "Bob", "Charles") How can I produce the following results: "Alice, Bob, Charles" ? paste? merge? Thank you very much! [[alternative HTML version deleted]] __ R-help@r-project.org mailin

Re: [R] String concatenation

2008-06-28 Thread Andy Fugard
On 28 Jun 2008, at 16:20, Peng Jiang wrote: Hi, Andy I am a little confused, why don't you just use paste() directly? > paste("12","3","45",sep="") produce the same result with your concat. The problem is that I have a vector, not those individual arguments. But the collapse argument does

Re: [R] String concatenation

2008-06-28 Thread Prof Brian Ripley
paste(v, collapse="") On Sat, 28 Jun 2008, Andy Fugard wrote: Hi, Is the following function built in somewhere? concat = function(v) { res = "" for (i in 1:length(v)) res = paste(res,v[i],sep="") res } e.g. concat(c("12","3","45")) [1] "12345" Cheers, Andy -- Andy Fugard, Postg

Re: [R] String concatenation

2008-06-28 Thread Peng Jiang
Hi, Andy I am a little confused, why don't you just use paste() directly? > paste("12","3","45",sep="") produce the same result with your concat. regards . On 2008-6-28, at 下午7:44, Andy Fugard wrote: Hi, Is the following function built in somewhere? concat = function(v) { res = "" for

[R] String concatenation

2008-06-28 Thread Andy Fugard
Hi, Is the following function built in somewhere? concat = function(v) { res = "" for (i in 1:length(v)) res = paste(res,v[i],sep="") res } e.g. > concat(c("12","3","45")) [1] "12345" Cheers, Andy -- Andy Fugard, Postgraduate Research Student Psychology (Room F3), The University

[R] String concatenation, File Path Handling to pass to download.file( ) [backslash in DOS paths]

2007-10-15 Thread Vishal Belsare
Gabor, Thanks much. Your solution is elegant. My overall scheme is to take present date, and check whether it is a weekend, if not, then create a string based on the date, to concatenate into a url link for download.file( ). The files I need to download have a part which is in the format: mmddyy.

[R] String concatenation, File Path Handling to pass to download.file( ) [backslash in DOS paths]

2007-10-15 Thread Vishal Belsare
Gabor, Thanks much. Your solution is elegant. My overall scheme is to take present date, and check whether it is a weekend, if not, then create a string based on the date, to concatenate into a url link for download.file( ). The files I need to download have a part which is in the format: mmddyy.