Re: [R] Transfer Crosstable to Word-Document

2008-02-19 Thread Udo König
Greg,
thank you for the nice overview, which is very helpful.
Today I tested the HTML-Tool (Hmisc-library). First I had to install
the HeVea translater (it´s a little bit tricky). I could produce a little
html-table (it made me happy).

I will be out of office until monday - it would be nice to continue our
communication next week.

Thanks to you and all list members!
Udo



Zitat von Greg Snow <[EMAIL PROTECTED]>:

> There are several options available to you depending on your knowledge and
> workflow.
>
> Others have mentioned using Excel to format the table and to copy that into
> word, one thing along those lines that has not been mentioned yet is that if
> you have your data in a matrix or data frame then (on windows at least, I
> have not tried on other platforms) you can type:
>
> > write.table(my.data, 'clipboard', sep="\t")
>
> Then in Excel just do a paste and the data is there, this saves a couple of
> steps from saving as a .csv file and importing that into excel.  This would
> probably be fine for a few tables.
>
> With a little effort on your part, odfWeave may still be an option.  I have a
> project based on a survey with quite a few questions, but the output wanted
> was basically one of 3 tables and graphs based on a question or set of
> questions.  I wrote a set of functions that found the correct columns in the
> data and created a matrix with the appropriate table values and used the
> odfTable function to do the formating (and a set of functions to do the
> graphs).  Then I created an odf template file in OpenOffice that called the
> appropriate functions for each question, ran that through odfWeave, opened
> the result in OpenOffice and saved it as a word file to send to the clients.
> Another nice thing about this approach is that occasionally I get requests
> for the same output on a subset of the data, I just create the subset, rerun
> odfWeave, convert to word and I'm done (I don't let the client know that it
> was that easy though).  I think there is something in the works to allow
> conversion of odf files to ms word files from a command line.
>
> You can also use the existing LaTeX tools that others have suggested, then
> convert from latex to HTML or RTF or another format that can be read into
> word.  If you take this approach wich will require a few intermediate steps
> between R and word, then you may want to learn the make utility (there are
> versions of make available on windows, otherwise I don't know how I would
> survive trapped in an MS workplace).  Make helps with automating several step
> processes and updating only those parts that need to be updated.
>
> If you can give some more detail on what you want to do and how you want the
> output to look, then we can give more specific ideas on how to get there.
>
> Hope this helps,
>
> --
> Gregory (Greg) L. Snow Ph.D.
> Statistical Data Center
> Intermountain Healthcare
> [EMAIL PROTECTED]
> (801) 408-8111
>
>
>
> > -Original Message-
> > From: Udo König [mailto:[EMAIL PROTECTED]
> > Sent: Sunday, February 17, 2008 11:08 AM
> > To: r-help@r-project.org
> > Cc: Greg Snow
> > Subject: RE: [R] Transfer Crosstable to Word-Document
> >
> > Zitat von Greg Snow <[EMAIL PROTECTED]>:
> >
> > > If your final goal is a word document, then you should look at the
> > > odfWeave package.
> >
> > Greg,
> > I had a look at the odfWeave package, but it seems that
> > complex tables, for instance produced with latex() can´t
> > be produced/included, as can be done with sweave.
> >
> >
> > --------
> > Udo König
> > Clinic for Child an Adolescent Psychiatry Philipps University
> > of Marburg / Germany
> >
> > 
> > This message was sent using IMP, the Internet Messaging Program.
> >
> >
>
>




Udo König
Clinic for Child an Adolescent Psychiatry
Philipps University of Marburg / Germany

__
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] Transfer Crosstable to Word-Document

2008-02-17 Thread Udo König
Zitat von Greg Snow <[EMAIL PROTECTED]>:

> If your final goal is a word document, then you should look at the odfWeave
> package.

Greg,
I had a look at the odfWeave package, but it seems that complex tables, for
instance produced with latex() can´t be produced/included, as can be done
with sweave.


--------
Udo König
Clinic for Child an Adolescent Psychiatry
Philipps University of Marburg / Germany

__
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] Transfer Crosstable to Word-Document

2008-02-17 Thread Udo König
(2. attempt to post this)
(Udo)


Quoting Greg Snow <[EMAIL PROTECTED]>:

> If your final goal is a word document, then you should look at the odfWeave
> package.
>

At work my primary goal has to be a word document, because:

 * we have a Windows-XP network with MS-Office software
 * my boss and my colleagues are not firm with other software (I have to
   cooperate with them)

My idea is to insert simple tables into Word (what I asked for in this thread)
and to make more sohisticated tables -like [1]- with latex and include them as
a graphic file. I would NOT like to make such a table with MS-Word! I read an
introductory Latex script and asked our admin to install the Miktex package on
my computer.

At home I can fortunately do what I want (Windows, Linux, OpenOffice,...).

Greg:
To the odfWeave package: in [2] I found the sentence "The package is currently
limited to creating text documents using OpenOffice". So it doesn´t seem work
with MS-Word?



[1] #Taken from:
http://biostat.mc.vanderbilt.edu/twiki/pub/Main/StatReport/summary.pdf, p. 28

library(Hmisc)
getHdata(pbc)
attach(pbc)

s5 <- summary(drug ~ bili + albumin + stage + protime + sex + age + spiders,
  method="reverse", dta=pbc, test=TRUE)
options(digits=1)
print(s5, npct="both")
options(digits=3)

w <- latex(s5, size="smaller", npct="both",
   npct.size="smaller[2]", Nsize="smaller[2]",
   msdsize="smaller[2]",
   middle.bold=TRUE, landscape=TRUE)

wd <- dvi(w)
detach(pbc)


[2] R newsletter, Volume 6/4, October 2006, p.3



Udo König
Clinic for Child an Adolescent Psychiatry
Philipps University of Marburg / Germany

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