Using wdTable() within R2wd package‏

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Using wdTable() within R2wd package‏

Joann Zhuo
Hi All,
 
I am trying to use the wdTable() function within R2wd package to send a dataframe to MS-word. However, there is a problem with the tables that are generated by R.  For some reason the header row of the table also contains all the data.  You can see it by dragging the bottom border of the table down to make the row wider. For example, the  data named 'bod' should look like as:
        Time demand
1 1 8.3
2 2 10.3

However, if I use wdTable(bod), the output looks like

Time
demand

1
1
8.3

2
2
10.3

        Time demand
1 1 8.3
2 2 10.3

It means that the first cell of the table contains all values in the dataframe. Can anybody help me to solve this problem?

Thanks,
Joann
Reply | Threaded
Open this post in threaded view
|

Re: Using wdTable() within R2wd package‏

Tal Galili
Hi Joann,
I am not sure if it will help, but there is a post I wrote some time ago:
http://www.r-statistics.com/2010/05/exporting-r-output-to-ms-word-with-r2wd-an-example-session/

Please give it a look and see if that might help you figure out the problem.

Best,
Tal

----------------Contact
Details:-------------------------------------------------------
Contact me: [hidden email] |  972-52-7275845
Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) |
www.r-statistics.com (English)
----------------------------------------------------------------------------------------------




On Wed, Dec 21, 2011 at 6:17 PM, Joann Zhuo <[hidden email]> wrote:

> Hi All,
>
> I am trying to use the wdTable() function within R2wd package to send a
> dataframe to MS-word. However, there is a problem with the tables that are
> generated by R.  For some reason the header row of the table also contains
> all the data.  You can see it by dragging the bottom border of the table
> down to make the row wider. For example, the  data named 'bod' should look
> like as:
>        Time    demand
> 1       1       8.3
> 2       2       10.3
>
> However, if I use wdTable(bod), the output looks like
>
> Time
> demand
>
> 1
> 1
> 8.3
>
> 2
> 2
> 10.3
>
>        Time    demand
> 1       1       8.3
> 2       2       10.3
>
> It means that the first cell of the table contains all values in the
> dataframe. Can anybody help me to solve this problem?
>
> Thanks,
> Joann
>
> --
> View this message in context:
> http://r.789695.n4.nabble.com/Using-wdTable-within-R2wd-package-tp4222258p4222258.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> [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.
>

        [[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
|

Re: Using wdTable() within R2wd package‏

Joann Zhuo
Hi Tal,

Thank you very much! I ran your codes in the example session, but if you see the output by the codes of wdTable(format(head(mtcars))) and wdTable(head(mtcars)) in the word file,  the two tables have the same kind of problems. If you drag the bottom line of the first row down to make the heading row wider, some extra values appear in the first cell of heading row which will not look nice if I have a long column name and need a wider heading row in the table.  Do you know any ways to fix this problem?

Thanks,
Joann
Reply | Threaded
Open this post in threaded view
|

Re: Using wdTable() within R2wd package‏

Tal Galili
Hi Joann,
I am not sure I followed you.
My suggestion for you is actually to ask about this here:
http://superuser.com/

Cheers,
Tal


----------------Contact
Details:-------------------------------------------------------
Contact me: [hidden email] |  972-52-7275845
Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) |
www.r-statistics.com (English)
----------------------------------------------------------------------------------------------




On Thu, Dec 22, 2011 at 5:25 PM, Joann Zhuo <[hidden email]> wrote:

> Hi Tal,
>
> Thank you very much! I ran your codes in the example session, but if you
> see
> the output by the codes of wdTable(format(head(mtcars))) and
> wdTable(head(mtcars)) in the word file,  the two tables have the same kind
> of problems. If you drag the bottom line of the first row down to make the
> heading row wider, some extra values appear in the first cell of heading
> row
> which will not look nice if I have a long column name and need a wider
> heading row in the table.  Do you know any ways to fix this problem?
>
> Thanks,
> Joann
>
> --
> View this message in context:
> http://r.789695.n4.nabble.com/Using-wdTable-within-R2wd-package-tp4222258p4225629.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> [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.
>

        [[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.