Re: [R] character vector to text with returns

2011-08-30 Thread Ben qant
David, Yes, I understand that cat() won't do what I want, but that is the only way I can illustrate what I am after. Note the phrasing in my question: '...cat() like...' Regarding assigning the paste to a variable: it produces the same error. I've already tried that. Thanks for your suggestion!

Re: [R] character vector to text with returns

2011-08-30 Thread David Winsemius
On Aug 30, 2011, at 1:09 PM, Ben qant wrote: Hello, (Sorry if this is a dup post...) I need to clarify, Henrique's suggestion worked great for getting the text that I needed via cat(), but I haven't sorted out how to get cat() like output into a variable so I can pass it into the message

Re: [R] character vector to text with returns

2011-08-30 Thread Ben qant
Hello, (Sorry if this is a dup post...) I need to clarify, Henrique's suggestion worked great for getting the text that I needed via cat(), but I haven't sorted out how to get cat() like output into a variable so I can pass it into the message body variable I am using. Here is what I mean: x [1

Re: [R] character vector to text with returns

2011-08-30 Thread Ben qant
Hello, I need to clarify, Henrique's suggestion worked great for getting the text that I needed via cat(), but I haven't sorted out how to get cat() like output into a variable so I can pass it into the message body variable I am using. Here is what I mean: x [1] "a" "b" "c" "d" paste(x,collaps

Re: [R] character vector to text with returns

2011-08-29 Thread Bert Gunter
Is something like this what you want? x <- letters[1:4] x y <-do.call(paste,c( paste('"',x[1]), as.list(x[2:3]), paste(x[4],'"'),sep="\n")) y cat(y,"\n") -- Bert On Mon, Aug 29, 2011 at 6:59 PM, Ben qant wrote: > Unfortunately that didn't work. I just says the text is an invalid argument. > I

Re: [R] character vector to text with returns

2011-08-29 Thread Jeff Newmiller
Perhaps you need to conform to the conventions mandated by RFC 2822 section 2.1 for record separators. Most libraries automatically handle this for you, but perhaps your rJython library does not. --- Jeff Newmiller The .

Re: [R] character vector to text with returns

2011-08-29 Thread Ben qant
Unfortunately that didn't work. I just says the text is an invalid argument. I also tried saving it in a variable name and passed that in, but that didn't work. I get: Error in ls(envir = envir, all.names = private) : invalid 'envir' argument ...when I try to send the message. Any other ideas?

Re: [R] character vector to text with returns

2011-08-29 Thread Henrique Dallazuanna
Try: paste(c("a", "b", "c"), collapse = "\n") On Mon, Aug 29, 2011 at 8:56 PM, Ben qant wrote: > Hello, > > Does anyone know how to convert this: > > msg > [1] "a" > [2] "b" > [3] "c" > > > To: > > > msg > "a > b > c" > > In other words, I need to convert a character vector to a single str