Quantcast

Export a plot/figure to excel or word?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Export a plot/figure to excel or word?

Aurelie Cosandey Godin
Hi all,

I have created forest plots using the package "meta" that I submitted as pdf for publication. I just received an email from the editor asking me if I could send these files in an Excel or MS Word format such that they can treat them as tables with box plots.

I am not sure if I can do this... Is this possible? I've tried the capture.output command, but I get a blank MS Word document.

Thank you very much in advance,
Best,

Aurelie


Aurelie Cosandey-Godin
Ph.D. student, Department of Biology
Industrial Graduate Fellow, WWF-Canada

Dalhousie University | Biology Dept. | 1459 Oxford Street |Halifax, NS | Canada B3H 4R2  
Phone: 1-902-494-2146 | cell: 1-902-412-3404 |Fax: 1-902-494-3736
Email: [hidden email] | Skype: aureliegodinco | Web: wormlab.biology.dal.ca
----------------------------------------------------------------------------------------------------------------------------------------------------
Want to learn more about sharks in Atlantic Canada? Visit ShARCC! www.atlanticsharks.org













        [[alternative HTML version deleted]]

______________________________________________
[hidden email] 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 | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Export a plot/figure to excel or word?

Michael Weylandt
Hmmm, that seems an odd request: how could one make a plot in Excel
natively (excepting ASCII art)?

Perhaps write and ask them if they can take any image formats? R
exports to most of them quite nicely: png, eps, jpeg, bitmap, svg,
etc.

Michael

On Wed, Mar 14, 2012 at 3:49 PM, Aurelie Cosandey Godin <[hidden email]> wrote:

> Hi all,
>
> I have created forest plots using the package "meta" that I submitted as pdf for publication. I just received an email from the editor asking me if I could send these files in an Excel or MS Word format such that they can treat them as tables with box plots.
>
> I am not sure if I can do this... Is this possible? I've tried the capture.output command, but I get a blank MS Word document.
>
> Thank you very much in advance,
> Best,
>
> Aurelie
>
>
> Aurelie Cosandey-Godin
> Ph.D. student, Department of Biology
> Industrial Graduate Fellow, WWF-Canada
>
> Dalhousie University | Biology Dept. | 1459 Oxford Street |Halifax, NS | Canada B3H 4R2
> Phone: 1-902-494-2146 | cell: 1-902-412-3404 |Fax: 1-902-494-3736
> Email: [hidden email] | Skype: aureliegodinco | Web: wormlab.biology.dal.ca
> ----------------------------------------------------------------------------------------------------------------------------------------------------
> Want to learn more about sharks in Atlantic Canada? Visit ShARCC! www.atlanticsharks.org
>
>
>
>
>
>
>
>
>
>
>
>
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] 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.

______________________________________________
[hidden email] 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 | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Export a plot/figure to excel or word?

Steve Taylor
In reply to this post by Aurelie Cosandey Godin
I have found the TIF format (with lossless compression) most suitable for inclusion in Word documents.  

Here's my function for producing a tif plot...

word.tif <- function(filename="Word_Figure.tif", zoom=5, res=96*zoom, width=17, height=10, pointsize=10, bg='white') {
  if (!filename %like% "[.]ti[f]+$") filename = paste(filename,"tif",sep='.')
  tiff(filename=filename, res=res, width=width, height=height, units='cm', pointsize=pointsize, bg=bg, compression="lzw")
}

# usage...
word.tif('random normals', width=10, height=10)  # centimetres
plot(rnorm(100))
dev.off()


-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Aurelie Cosandey Godin
Sent: Thursday, 15 March 2012 8:50a
To: [hidden email]
Subject: [R] Export a plot/figure to excel or word?

Hi all,

I have created forest plots using the package "meta" that I submitted as pdf for publication. I just received an email from the editor asking me if I could send these files in an Excel or MS Word format such that they can treat them as tables with box plots.

I am not sure if I can do this... Is this possible? I've tried the capture.output command, but I get a blank MS Word document.

Thank you very much in advance,
Best,

Aurelie


Aurelie Cosandey-Godin
Ph.D. student, Department of Biology
Industrial Graduate Fellow, WWF-Canada

Dalhousie University | Biology Dept. | 1459 Oxford Street |Halifax, NS | Canada B3H 4R2  
Phone: 1-902-494-2146 | cell: 1-902-412-3404 |Fax: 1-902-494-3736
Email: [hidden email] | Skype: aureliegodinco | Web: wormlab.biology.dal.ca
----------------------------------------------------------------------------------------------------------------------------------------------------
Want to learn more about sharks in Atlantic Canada? Visit ShARCC! www.atlanticsharks.org













        [[alternative HTML version deleted]]

______________________________________________
[hidden email] 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.

______________________________________________
[hidden email] 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 | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Export a plot/figure to excel or word?

William Dunlap
In reply to this post by Michael Weylandt
Perhaps using the win.metafile() graphics device (instead of pdf()) would work.

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com


> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On Behalf
> Of R. Michael Weylandt
> Sent: Wednesday, March 14, 2012 12:56 PM
> To: Aurelie Cosandey Godin
> Cc: [hidden email]
> Subject: Re: [R] Export a plot/figure to excel or word?
>
> Hmmm, that seems an odd request: how could one make a plot in Excel
> natively (excepting ASCII art)?
>
> Perhaps write and ask them if they can take any image formats? R
> exports to most of them quite nicely: png, eps, jpeg, bitmap, svg,
> etc.
>
> Michael
>
> On Wed, Mar 14, 2012 at 3:49 PM, Aurelie Cosandey Godin <[hidden email]> wrote:
> > Hi all,
> >
> > I have created forest plots using the package "meta" that I submitted as pdf for
> publication. I just received an email from the editor asking me if I could send these files in
> an Excel or MS Word format such that they can treat them as tables with box plots.
> >
> > I am not sure if I can do this... Is this possible? I've tried the capture.output command,
> but I get a blank MS Word document.
> >
> > Thank you very much in advance,
> > Best,
> >
> > Aurelie
> >
> >
> > Aurelie Cosandey-Godin
> > Ph.D. student, Department of Biology
> > Industrial Graduate Fellow, WWF-Canada
> >
> > Dalhousie University | Biology Dept. | 1459 Oxford Street |Halifax, NS | Canada B3H
> 4R2
> > Phone: 1-902-494-2146 | cell: 1-902-412-3404 |Fax: 1-902-494-3736
> > Email: [hidden email] | Skype: aureliegodinco | Web: wormlab.biology.dal.ca
> > ----------------------------------------------------------------------------------------------------------
> ------------------------------------------
> > Want to learn more about sharks in Atlantic Canada? Visit ShARCC!
> www.atlanticsharks.org
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >        [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > [hidden email] 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.
>
> ______________________________________________
> [hidden email] 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.

______________________________________________
[hidden email] 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 | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Export a plot/figure to excel or word?

Aurelie Cosandey Godin
In reply to this post by Michael Weylandt
Thank you Michael,

Yes it appeared odd to me too... I'll email them back to verify.
Thanks!

Aurelie
On 2012-03-14, at 4:56 PM, R. Michael Weylandt wrote:

> Hmmm, that seems an odd request: how could one make a plot in Excel
> natively (excepting ASCII art)?
>
> Perhaps write and ask them if they can take any image formats? R
> exports to most of them quite nicely: png, eps, jpeg, bitmap, svg,
> etc.
>
> Michael
>
> On Wed, Mar 14, 2012 at 3:49 PM, Aurelie Cosandey Godin <[hidden email]> wrote:
>> Hi all,
>>
>> I have created forest plots using the package "meta" that I submitted as pdf for publication. I just received an email from the editor asking me if I could send these files in an Excel or MS Word format such that they can treat them as tables with box plots.
>>
>> I am not sure if I can do this... Is this possible? I've tried the capture.output command, but I get a blank MS Word document.
>>
>> Thank you very much in advance,
>> Best,
>>
>> Aurelie
>>
>>
>> Aurelie Cosandey-Godin
>> Ph.D. student, Department of Biology
>> Industrial Graduate Fellow, WWF-Canada
>>
>> Dalhousie University | Biology Dept. | 1459 Oxford Street |Halifax, NS | Canada B3H 4R2
>> Phone: 1-902-494-2146 | cell: 1-902-412-3404 |Fax: 1-902-494-3736
>> Email: [hidden email] | Skype: aureliegodinco | Web: wormlab.biology.dal.ca
>> ----------------------------------------------------------------------------------------------------------------------------------------------------
>> Want to learn more about sharks in Atlantic Canada? Visit ShARCC! www.atlanticsharks.org
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>        [[alternative HTML version deleted]]
>>
>> ______________________________________________
>> [hidden email] 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.
>

______________________________________________
[hidden email] 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 | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Export a plot/figure to excel or word?

Steve Taylor
In reply to this post by Aurelie Cosandey Godin
Oops, this uses one of my own functions %like%

"%like%" <- function(x,y) grepl(y,x,ignore=TRUE)

Here's an improved version of word.tif ...
word.tif <- function(filename="Word_Figure_%03d.tif", zoom=5, width=17, height=10, pointsize=10, ...) {
  if (!grepl("[.]ti[f]+$", filename,ignore.case=TRUE) filename = paste(filename,"tif",sep='.')
  tiff(filename=filename, res=96*zoom, width=width, height=height, units='cm', pointsize=pointsize, compression="lzw", ...)
}

Note the zoom, which creates high quality images by default.

S

-----Original Message-----
From: Steve Taylor
Sent: Thursday, 15 March 2012 9:01a
To: 'Aurelie Cosandey Godin'; [hidden email]
Subject: RE: [R] Export a plot/figure to excel or word?

I have found the TIF format (with lossless compression) most suitable for inclusion in Word documents.  

Here's my function for producing a tif plot...

word.tif <- function(filename="Word_Figure.tif", zoom=5, res=96*zoom, width=17, height=10, pointsize=10, bg='white') {
  if (!filename %like% "[.]ti[f]+$") filename = paste(filename,"tif",sep='.')
  tiff(filename=filename, res=res, width=width, height=height, units='cm', pointsize=pointsize, bg=bg, compression="lzw") }

# usage...
word.tif('random normals', width=10, height=10)  # centimetres
plot(rnorm(100))
dev.off()


-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Aurelie Cosandey Godin
Sent: Thursday, 15 March 2012 8:50a
To: [hidden email]
Subject: [R] Export a plot/figure to excel or word?

Hi all,

I have created forest plots using the package "meta" that I submitted as pdf for publication. I just received an email from the editor asking me if I could send these files in an Excel or MS Word format such that they can treat them as tables with box plots.

I am not sure if I can do this... Is this possible? I've tried the capture.output command, but I get a blank MS Word document.

Thank you very much in advance,
Best,

Aurelie


Aurelie Cosandey-Godin
Ph.D. student, Department of Biology
Industrial Graduate Fellow, WWF-Canada

Dalhousie University | Biology Dept. | 1459 Oxford Street |Halifax, NS | Canada B3H 4R2
Phone: 1-902-494-2146 | cell: 1-902-412-3404 |Fax: 1-902-494-3736
Email: [hidden email] | Skype: aureliegodinco | Web: wormlab.biology.dal.ca
----------------------------------------------------------------------------------------------------------------------------------------------------
Want to learn more about sharks in Atlantic Canada? Visit ShARCC! www.atlanticsharks.org













        [[alternative HTML version deleted]]

______________________________________________
[hidden email] 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.

______________________________________________
[hidden email] 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.
Loading...