[R] Sending a matrix in an email
I have a matrix which has colnames and I would like to send this matrix using sendmailR. How can I convert this simple matrix to a format which can be used as the body variable in sendmailR? I see how I can create a file attachment using mime_part but I would like to send the matrix in the body of the email. The matrix looks like: ABD DEF GHI JKL MNO TOT [1,] 0.44 0.81 1.67 0.37 0.31 -1.18 All the conversions I have tried end up sending the matrix without the colnames. Thanks. __ 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.
Re: [R] Sending a matrix in an email
Have you tried dput(your.matrix)? ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie Kwaliteitszorg / team Biometrics Quality Assurance Kliniekstraat 25 1070 Anderlecht Belgium + 32 2 525 02 51 + 32 54 43 61 85 thierry.onkel...@inbo.be www.inbo.be To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of. ~ Sir Ronald Aylmer Fisher The plural of anecdote is not data. ~ Roger Brinner The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data. ~ John Tukey -Oorspronkelijk bericht- Van: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Namens Ira Fuchs Verzonden: maandag 18 november 2013 14:35 Aan: r-help@r-project.org Onderwerp: [R] Sending a matrix in an email I have a matrix which has colnames and I would like to send this matrix using sendmailR. How can I convert this simple matrix to a format which can be used as the body variable in sendmailR? I see how I can create a file attachment using mime_part but I would like to send the matrix in the body of the email. The matrix looks like: ABD DEF GHI JKL MNO TOT [1,] 0.44 0.81 1.67 0.37 0.31 -1.18 All the conversions I have tried end up sending the matrix without the colnames. Thanks. __ 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. * * * * * * * * * * * * * D I S C L A I M E R * * * * * * * * * * * * * Dit bericht en eventuele bijlagen geven enkel de visie van de schrijver weer en binden het INBO onder geen enkel beding, zolang dit bericht niet bevestigd is door een geldig ondertekend document. The views expressed in this message and any annex are purely those of the writer and may not be regarded as stating an official position of INBO, as long as the message is not confirmed by a duly signed document. __ 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.
Re: [R] Sending a matrix in an email
What about dput()? On Mon, Nov 18, 2013 at 8:35 AM, Ira Fuchs irafu...@gmail.com wrote: I have a matrix which has colnames and I would like to send this matrix using sendmailR. How can I convert this simple matrix to a format which can be used as the body variable in sendmailR? I see how I can create a file attachment using mime_part but I would like to send the matrix in the body of the email. The matrix looks like: ABD DEF GHI JKL MNO TOT [1,] 0.44 0.81 1.67 0.37 0.31 -1.18 All the conversions I have tried end up sending the matrix without the colnames. Thanks. __ 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.
Re: [R] Sending a matrix in an email
On 18 November 2013 05:37, Ira Fuchs irafu...@gmail.com wrote: I have a matrix which has colnames and I would like to send this matrix using sendmailR. How can I convert this simple matrix My 1 cent; In case of large objects or full session, suitable for attachment; RData might be more convenient, i.e., ?save or ?save.image __ 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.
Re: [R] Sending a matrix in an email
Thanks for the suggestion. I just tried dput and it did not produce what sendmailR requires for the body parameter. Here is a simplified version of what I need to do: x=matrix(c(1,2,3),1,3) x [,1] [,2] [,3] [1,]123 colnames(x)=c(a,b,c) x a b c [1,] 1 2 3 dput(x) structure(c(1, 2, 3), .Dim = c(1L, 3L), .Dimnames = list(NULL, c(a, b, c))) I want to send x in sendmailR(to,from,x) and have it look more or less like the output above. Simple, right? On Nov 18, 2013, at 9:13 AM, Sarah Goslee wrote: What about dput()? On Mon, Nov 18, 2013 at 8:35 AM, Ira Fuchs irafu...@gmail.com wrote: I have a matrix which has colnames and I would like to send this matrix using sendmailR. How can I convert this simple matrix to a format which can be used as the body variable in sendmailR? I see how I can create a file attachment using mime_part but I would like to send the matrix in the body of the email. The matrix looks like: ABD DEF GHI JKL MNO TOT [1,] 0.44 0.81 1.67 0.37 0.31 -1.18 All the conversions I have tried end up sending the matrix without the colnames. Thanks. __ 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.
Re: [R] Sending a matrix in an email
On Nov 18, 2013, at 8:30 AM, Ira Fuchs wrote: Thanks for the suggestion. I just tried dput and it did not produce what sendmailR requires for the body parameter. Here is a simplified version of what I need to do: x=matrix(c(1,2,3),1,3) x [,1] [,2] [,3] [1,]123 colnames(x)=c(a,b,c) x a b c [1,] 1 2 3 dput(x) structure(c(1, 2, 3), .Dim = c(1L, 3L), .Dimnames = list(NULL, c(a, b, c))) I want to send x in sendmailR(to,from,x) and have it look more or less like the output above. Simple, right? After this at the console: sink(myfile.txt) x=matrix(c(1,2,3),1,3) x colnames(x)=c(a,b,c) x sink() I get this in myfile.txt: [,1] [,2] [,3] [1,]123 a b c [1,] 1 2 3 There is also a capture.output function. -- David On Nov 18, 2013, at 9:13 AM, Sarah Goslee wrote: What about dput()? On Mon, Nov 18, 2013 at 8:35 AM, Ira Fuchs irafu...@gmail.com wrote: I have a matrix which has colnames and I would like to send this matrix using sendmailR. How can I convert this simple matrix to a format which can be used as the body variable in sendmailR? I see how I can create a file attachment using mime_part but I would like to send the matrix in the body of the email. The matrix looks like: ABD DEF GHI JKL MNO TOT [1,] 0.44 0.81 1.67 0.37 0.31 -1.18 All the conversions I have tried end up sending the matrix without the colnames. Thanks. __ 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. David Winsemius, MD Alameda, CA, USA __ 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.
Re: [R] Sending a matrix in an email
That's the ticket! So many functions…so little time. Thanks to everyone. On Nov 18, 2013, at 9:47 AM, David Winsemius wrote: On Nov 18, 2013, at 8:30 AM, Ira Fuchs wrote: Thanks for the suggestion. I just tried dput and it did not produce what sendmailR requires for the body parameter. Here is a simplified version of what I need to do: x=matrix(c(1,2,3),1,3) x [,1] [,2] [,3] [1,]123 colnames(x)=c(a,b,c) x a b c [1,] 1 2 3 dput(x) structure(c(1, 2, 3), .Dim = c(1L, 3L), .Dimnames = list(NULL, c(a, b, c))) I want to send x in sendmailR(to,from,x) and have it look more or less like the output above. Simple, right? After this at the console: sink(myfile.txt) x=matrix(c(1,2,3),1,3) x colnames(x)=c(a,b,c) x sink() I get this in myfile.txt: [,1] [,2] [,3] [1,]123 a b c [1,] 1 2 3 There is also a capture.output function. -- David On Nov 18, 2013, at 9:13 AM, Sarah Goslee wrote: What about dput()? On Mon, Nov 18, 2013 at 8:35 AM, Ira Fuchs irafu...@gmail.com wrote: I have a matrix which has colnames and I would like to send this matrix using sendmailR. How can I convert this simple matrix to a format which can be used as the body variable in sendmailR? I see how I can create a file attachment using mime_part but I would like to send the matrix in the body of the email. The matrix looks like: ABD DEF GHI JKL MNO TOT [1,] 0.44 0.81 1.67 0.37 0.31 -1.18 All the conversions I have tried end up sending the matrix without the colnames. Thanks. __ 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. David Winsemius, MD Alameda, CA, USA __ 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.
Re: [R] Sending a matrix in an email
I think it'd be easier and safer to save the matrix, either as an .Rdata binary or as a text file, zip that file, and use the sendmailR tools to attach the file to your message. Fuchs Ira-3 wrote I have a matrix which has colnames and I would like to send this matrix using sendmailR. How can I convert this simple matrix to a format which can be used as the body variable in sendmailR? I see how I can create a file attachment using mime_part but I would like to send the matrix in the body of the email. The matrix looks like: ABD DEF GHI JKL MNO TOT [1,] 0.44 0.81 1.67 0.37 0.31 -1.18 All the conversions I have tried end up sending the matrix without the colnames. Thanks. [[alternative HTML version deleted]] __ R-help@ 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. -- View this message in context: http://r.789695.n4.nabble.com/Sending-a-matrix-in-an-email-tp4680663p4680675.html Sent from the R help mailing list archive at Nabble.com. __ 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.
Re: [R] Sending a matrix in an email
You have not provided the minimal reproducible code that the footer of this email asks for, so we are playing 20 questions. Perhaps you should convert the matrix to a data frame? Or is this an example of FAQ 7.16? --- Jeff NewmillerThe . . Go Live... DCN:jdnew...@dcn.davis.ca.usBasics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/BatteriesO.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --- Sent from my phone. Please excuse my brevity. Ira Fuchs irafu...@gmail.com wrote: Thanks for the suggestion. I just tried dput and it did not produce what sendmailR requires for the body parameter. Here is a simplified version of what I need to do: x=matrix(c(1,2,3),1,3) x [,1] [,2] [,3] [1,]123 colnames(x)=c(a,b,c) x a b c [1,] 1 2 3 dput(x) structure(c(1, 2, 3), .Dim = c(1L, 3L), .Dimnames = list(NULL, c(a, b, c))) I want to send x in sendmailR(to,from,x) and have it look more or less like the output above. Simple, right? On Nov 18, 2013, at 9:13 AM, Sarah Goslee wrote: What about dput()? On Mon, Nov 18, 2013 at 8:35 AM, Ira Fuchs irafu...@gmail.com wrote: I have a matrix which has colnames and I would like to send this matrix using sendmailR. How can I convert this simple matrix to a format which can be used as the body variable in sendmailR? I see how I can create a file attachment using mime_part but I would like to send the matrix in the body of the email. The matrix looks like: ABD DEF GHI JKL MNO TOT [1,] 0.44 0.81 1.67 0.37 0.31 -1.18 All the conversions I have tried end up sending the matrix without the colnames. Thanks. __ 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. __ 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.
Re: [R] Sending a matrix in an email
I thought that I had provided an example of what I wanted to do but in any case, capture.output seems to work, as in sendmailR(to,from, capture.output(matrix_to_send)) I'm sure that there are myriad other ways (I tried print, which is mentioned in FAQ 7.16 but it doesn't work in this context) Thanks for your help. On Nov 18, 2013, at 10:04 AM, Jeff Newmiller wrote: You have not provided the minimal reproducible code that the footer of this email asks for, so we are playing 20 questions. Perhaps you should convert the matrix to a data frame? Or is this an example of FAQ 7.16? --- Jeff NewmillerThe . . Go Live... DCN:jdnew...@dcn.davis.ca.usBasics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/BatteriesO.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --- Sent from my phone. Please excuse my brevity. Ira Fuchs irafu...@gmail.com wrote: Thanks for the suggestion. I just tried dput and it did not produce what sendmailR requires for the body parameter. Here is a simplified version of what I need to do: x=matrix(c(1,2,3),1,3) x [,1] [,2] [,3] [1,]123 colnames(x)=c(a,b,c) x a b c [1,] 1 2 3 dput(x) structure(c(1, 2, 3), .Dim = c(1L, 3L), .Dimnames = list(NULL, c(a, b, c))) I want to send x in sendmailR(to,from,x) and have it look more or less like the output above. Simple, right? On Nov 18, 2013, at 9:13 AM, Sarah Goslee wrote: What about dput()? On Mon, Nov 18, 2013 at 8:35 AM, Ira Fuchs irafu...@gmail.com wrote: I have a matrix which has colnames and I would like to send this matrix using sendmailR. How can I convert this simple matrix to a format which can be used as the body variable in sendmailR? I see how I can create a file attachment using mime_part but I would like to send the matrix in the body of the email. The matrix looks like: ABD DEF GHI JKL MNO TOT [1,] 0.44 0.81 1.67 0.37 0.31 -1.18 All the conversions I have tried end up sending the matrix without the colnames. Thanks. __ 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. __ 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.
Re: [R] Sending a matrix in an email
You provided examples of what you wanted, but not examples where the same code in a different context failed to provide the result you wanted. Reproducible means reproduces the problem. --- Jeff NewmillerThe . . Go Live... DCN:jdnew...@dcn.davis.ca.usBasics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/BatteriesO.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --- Sent from my phone. Please excuse my brevity. Ira Fuchs irafu...@gmail.com wrote: I thought that I had provided an example of what I wanted to do but in any case, capture.output seems to work, as in sendmailR(to,from, capture.output(matrix_to_send)) I'm sure that there are myriad other ways (I tried print, which is mentioned in FAQ 7.16 but it doesn't work in this context) Thanks for your help. On Nov 18, 2013, at 10:04 AM, Jeff Newmiller wrote: You have not provided the minimal reproducible code that the footer of this email asks for, so we are playing 20 questions. Perhaps you should convert the matrix to a data frame? Or is this an example of FAQ 7.16? --- Jeff NewmillerThe . . Go Live... DCN:jdnew...@dcn.davis.ca.usBasics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/BatteriesO.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --- Sent from my phone. Please excuse my brevity. Ira Fuchs irafu...@gmail.com wrote: Thanks for the suggestion. I just tried dput and it did not produce what sendmailR requires for the body parameter. Here is a simplified version of what I need to do: x=matrix(c(1,2,3),1,3) x [,1] [,2] [,3] [1,]123 colnames(x)=c(a,b,c) x a b c [1,] 1 2 3 dput(x) structure(c(1, 2, 3), .Dim = c(1L, 3L), .Dimnames = list(NULL, c(a, b, c))) I want to send x in sendmailR(to,from,x) and have it look more or less like the output above. Simple, right? On Nov 18, 2013, at 9:13 AM, Sarah Goslee wrote: What about dput()? On Mon, Nov 18, 2013 at 8:35 AM, Ira Fuchs irafu...@gmail.com wrote: I have a matrix which has colnames and I would like to send this matrix using sendmailR. How can I convert this simple matrix to a format which can be used as the body variable in sendmailR? I see how I can create a file attachment using mime_part but I would like to send the matrix in the body of the email. The matrix looks like: ABD DEF GHI JKL MNO TOT [1,] 0.44 0.81 1.67 0.37 0.31 -1.18 All the conversions I have tried end up sending the matrix without the colnames. Thanks. __ 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. __ 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.
Re: [R] Sending a matrix in an email
I understand what you are saying. I just didn't think that showing a sendmailR with a matrix as the body of the message would have been very helpful since it is the fact that the received email has no content that is the problem and that would not have shown up in the R console output. On Nov 18, 2013, at 10:47 AM, Jeff Newmiller wrote: You provided examples of what you wanted, but not examples where the same code in a different context failed to provide the result you wanted. Reproducible means reproduces the problem. --- Jeff NewmillerThe . . Go Live... DCN:jdnew...@dcn.davis.ca.usBasics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/BatteriesO.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --- Sent from my phone. Please excuse my brevity. Ira Fuchs irafu...@gmail.com wrote: I thought that I had provided an example of what I wanted to do but in any case, capture.output seems to work, as in sendmailR(to,from, capture.output(matrix_to_send)) I'm sure that there are myriad other ways (I tried print, which is mentioned in FAQ 7.16 but it doesn't work in this context) Thanks for your help. On Nov 18, 2013, at 10:04 AM, Jeff Newmiller wrote: You have not provided the minimal reproducible code that the footer of this email asks for, so we are playing 20 questions. Perhaps you should convert the matrix to a data frame? Or is this an example of FAQ 7.16? --- Jeff NewmillerThe . . Go Live... DCN:jdnew...@dcn.davis.ca.usBasics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/BatteriesO.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --- Sent from my phone. Please excuse my brevity. Ira Fuchs irafu...@gmail.com wrote: Thanks for the suggestion. I just tried dput and it did not produce what sendmailR requires for the body parameter. Here is a simplified version of what I need to do: x=matrix(c(1,2,3),1,3) x [,1] [,2] [,3] [1,]123 colnames(x)=c(a,b,c) x a b c [1,] 1 2 3 dput(x) structure(c(1, 2, 3), .Dim = c(1L, 3L), .Dimnames = list(NULL, c(a, b, c))) I want to send x in sendmailR(to,from,x) and have it look more or less like the output above. Simple, right? On Nov 18, 2013, at 9:13 AM, Sarah Goslee wrote: What about dput()? On Mon, Nov 18, 2013 at 8:35 AM, Ira Fuchs irafu...@gmail.com wrote: I have a matrix which has colnames and I would like to send this matrix using sendmailR. How can I convert this simple matrix to a format which can be used as the body variable in sendmailR? I see how I can create a file attachment using mime_part but I would like to send the matrix in the body of the email. The matrix looks like: ABD DEF GHI JKL MNO TOT [1,] 0.44 0.81 1.67 0.37 0.31 -1.18 All the conversions I have tried end up sending the matrix without the colnames. Thanks. __ 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. __ 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.
Re: [R] Sending a matrix in an email
No, sorry to flog a dead horse, but you do not appear to get it yet and you really should understand this concept. The minimal reproducible example would have been R code that we could run that generated an email that you think should have the matrix in it, but does not. In practically all help queries on this list we should be able to run your code and see the not-desired behavior. --- Jeff NewmillerThe . . Go Live... DCN:jdnew...@dcn.davis.ca.usBasics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/BatteriesO.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --- Sent from my phone. Please excuse my brevity. Ira Fuchs irafu...@gmail.com wrote: I understand what you are saying. I just didn't think that showing a sendmailR with a matrix as the body of the message would have been very helpful since it is the fact that the received email has no content that is the problem and that would not have shown up in the R console output. On Nov 18, 2013, at 10:47 AM, Jeff Newmiller wrote: You provided examples of what you wanted, but not examples where the same code in a different context failed to provide the result you wanted. Reproducible means reproduces the problem. --- Jeff NewmillerThe . . Go Live... DCN:jdnew...@dcn.davis.ca.usBasics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/BatteriesO.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --- Sent from my phone. Please excuse my brevity. Ira Fuchs irafu...@gmail.com wrote: I thought that I had provided an example of what I wanted to do but in any case, capture.output seems to work, as in sendmailR(to,from, capture.output(matrix_to_send)) I'm sure that there are myriad other ways (I tried print, which is mentioned in FAQ 7.16 but it doesn't work in this context) Thanks for your help. On Nov 18, 2013, at 10:04 AM, Jeff Newmiller wrote: You have not provided the minimal reproducible code that the footer of this email asks for, so we are playing 20 questions. Perhaps you should convert the matrix to a data frame? Or is this an example of FAQ 7.16? --- Jeff NewmillerThe . . Go Live... DCN:jdnew...@dcn.davis.ca.usBasics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/BatteriesO.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --- Sent from my phone. Please excuse my brevity. Ira Fuchs irafu...@gmail.com wrote: Thanks for the suggestion. I just tried dput and it did not produce what sendmailR requires for the body parameter. Here is a simplified version of what I need to do: x=matrix(c(1,2,3),1,3) x [,1] [,2] [,3] [1,]123 colnames(x)=c(a,b,c) x a b c [1,] 1 2 3 dput(x) structure(c(1, 2, 3), .Dim = c(1L, 3L), .Dimnames = list(NULL, c(a, b, c))) I want to send x in sendmailR(to,from,x) and have it look more or less like the output above. Simple, right? On Nov 18, 2013, at 9:13 AM, Sarah Goslee wrote: What about dput()? On Mon, Nov 18, 2013 at 8:35 AM, Ira Fuchs irafu...@gmail.com wrote: I have a matrix which has colnames and I would like to send this matrix using sendmailR. How can I convert this simple matrix to a format which can be used as the body variable in sendmailR? I see how I can create a file attachment using mime_part but I would like to send the matrix in the body of the email. The matrix looks like: ABD DEF GHI JKL MNO TOT [1,] 0.44 0.81 1.67 0.37 0.31 -1.18 All the conversions I have tried end up sending the matrix without the colnames. Thanks. __ 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. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide
[R] Sending a matrix in an email
I have a matrix which has colnames and I would like to send this matrix using sendmailR. How can I convert this simple matrix to a format which can be used as the body variable in sendmailR? I see how I can create a file attachment using mime_part but I would like to send the matrix in the body of the email. The matrix looks like: ABD DEF GHI JKL MNO TOT [1,] 0.44 0.81 1.67 0.37 0.31 -1.18 All the conversions I have tried end up sending the matrix without the colnames. Thanks. [[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.