[R] OdfWeave problem

John Kane jrkrideau at inbox.com
Tue Dec 17 18:05:25 CET 2013


Thanks. As you will see from my reply I misread the manual and it shoud have been results = xml and I had tried XML. 

And result = 'asis'  works too.  I had thought it was unique to knitr and never thought to try it.

Thanks
John Kane
Kingston ON Canada


> -----Original Message-----
> From: jdnewmil at dcn.davis.ca.us
> Sent: Tue, 17 Dec 2013 08:20:50 -0800
> To: jrkrideau at inbox.com, r-help at r-project.org
> Subject: Re: [R] OdfWeave problem
> 
> I, like Duncan have not used odfweave, but with knitr you would not use
> result=TRUE, rather you would use result='asis'.
> ---------------------------------------------------------------------------
> Jeff Newmiller                        The     .....       .....  Go
> Live...
> DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live
> Go...
>                                       Live:   OO#.. Dead: OO#..  Playing
> Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
> /Software/Embedded Controllers)               .OO#.       .OO#.
> rocks...1k
> ---------------------------------------------------------------------------
> Sent from my phone. Please excuse my brevity.
> 
> John Kane <jrkrideau at inbox.com> wrote:
> >Thanks Duncan.
> >It sounds  logical but neither seem to work.
> >The code below and with output = gives the same result.
> ><<iris , echo = TRUE, result =TRUE>>=
> >odfItemize(levels(iris$Species))
>> @
>> 
> >I am beginning to wonder if I have something wrong with my
> >installation.
>> 
> >The worst of this is I have not used odfWeave in at least a year as I
> >like LyX/knitr better but I recommended that an AOO user try it and
> >figured I should at least be able to answer a few simple questions.
>> 
>> 
> >John Kane
> >Kingston ON Canada
>> 
>> 
>>> -----Original Message-----
>>> From: murdoch.duncan at gmail.com
>>> Sent: Tue, 17 Dec 2013 10:26:01 -0500
>>> To: jrkrideau at inbox.com, r-help at r-project.org
>>> Subject: Re: [R] OdfWeave problem
>>> 
>>> On 17/12/2013 10:00 AM, John Kane wrote:
>>>> I am trying to get odfWeave to work and I seem to be doing something
>>>> stupid. Straightforward inline statements and plain code chunks are
>>>> working fine but when I try to use an actual odfWeave statement I
> >get
>>>> what appears to be the xml and not odt format.  I am using Apache
>>>> OpenOffice 3. 4.0.  Sys.Info() at bottom.
>>>> Suggestions/ pointers appreciated.
>>>> 
>>>> In an odt file I tried the following:  The inline statements work,
> >the
>>>> dat1 chunk works the iris chunk gives me the following.
>>>> 
>>>> 
>>>>> odfItemize(levels(iris$Species))
>>>>       <text:list text:style-name="Rbullet" >
>>>>       <text:list-item>
>>>>        <text:p text:style-name="RbulletParagraph" > setosa
> ></text:p>
>>>>       </text:list-item>
>>>>       <text:list-item>
>>>>        <text:p text:style-name="RbulletParagraph" > versicolor
> ></text:p>
>>>>       </text:list-item>
>>>>       <text:list-item>
>>>>        <text:p text:style-name="RbulletParagraph" > virginica
> ></text:p>
>>>>       </text:list-item>
>>>>      </text:list>
>>>> 
>>>> ######--------------------------text in AOO file
>>>> ------------------------------------
>>>> 
>>>>   \Sexpr{paste(letters[1:5], collapse = ",")}. Okay so far, so good
> >and
>>>> π =  \Sexpr{round(pi, 4)}.
>>>> 
>>>> 
>>>> <<dat1, echo=FALSE >>=
>>>> Participant  <-  c(1,2,3,4,5,6,7,8,9,10)
>>>> Condition <-factor(c(1,1,1,1,1,2,2,2,2,2))
>>>> Score <- c(4,3,5,4,4,2,2,6,5,6)
>>>> Data <- data.frame(Participant,Condition,Score)
>>>> Data
>>>> @
>>>> 
>>>> <<iris , echo = TRUE>>=
>>>> odfItemize(levels(iris$Species))
>>>>   @
>>> 
>>> I don't use odfWeave, but by analogy with Sweave you probably need
> >some
>>> "result=" or "output=" option in the header to this code chunk, to
> >tell
>>> it not to escape everything, but just to include it as XML code to be
>>> processed.
>>> 
>>> Duncan Murdoch
>>> 
>>>> ###----------------------------end text in AOO file---------------
>>>> 
>>>> ##----------------------------------R program----------------
>>>> library(odfWeave)
>>>> inFile <- "odfWeave.example.odt"
>>>> outFile <- "outfile.odt"
>>>> 
>>>> odfWeave(inFile, outFile)
>>>> #===================================
>>>> 
>>>>   Sys.info()
>>>>                                        sysname
>>>> release
>>>>                                        "Linux"
>>>> "3.11.0-14-generic"
>>>>                                        version
>>>> nodename
>>>> "#21-Ubuntu SMP Tue Nov 12 17:07:40 UTC 2013"
>>>> "john-K53U"
>>>>                                        machine
>>>> login
>>>>                                         "i686"
>>>> "unknown"
>>>>                                           user
>>>> effective_user
>>>>                                         "john"
>>>> "john"
>>>> 
>>>> 
>>>> 
>>>> 
>>>> John Kane
>>>> Kingston ON Canada
>>>> 
>>>> ____________________________________________________________
>>>> FREE 3D EARTH SCREENSAVER - Watch the Earth right on your desktop!
>>>> 
>>>> ______________________________________________
>>>> R-help at 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.
>> 
> >____________________________________________________________
> >FREE ONLINE PHOTOSHARING - Share your photos online with your friends
> >and family!
> >Visit http://www.inbox.com/photosharing to find out more!
>> 
> >______________________________________________
> >R-help at 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.
>

____________________________________________________________
FREE 3D MARINE AQUARIUM SCREENSAVER - Watch dolphins, sharks & orcas on your desktop!



More information about the R-help mailing list