[R] Italicized title from index

From: Jeremy Newman <jnewm101_at_uottawa.ca>
Date: Thu, 31 Mar 2011 01:35:21 -0400


Hi all!

I've written a handy script that uses a for loop to allow me to generate a large number of figures and statistical outputs for a large dataset.

I am using indexing to retrieve a species name for the title of my graphswhich  worked fine. However, I need to italicize these species names.

I originally used the paste function, and had no problems with indexing:

*main=paste("Yield for ", testsub[1,3], " in management region ",
testsub[1,2])*

The title looks like: "*Yield for Gadus morhua in management region 4X5Y*"

I tried bquote from a related help thread, I tried to emulate it:

*spp<-testsub[1,3]*
*region<-testsub[1,2]*
*
*
*main=bquote(Yield ~ for ~ italic(.(spp)) ~ in ~ management ~ region ~
.(region))*

Which doesn't seem to work at all, but when I try not putting anything after the italic:

*main=bquote(Yield ~ for ~ italic(.(spp)))*

I get: "*Yield for 1*"
While *spp=Gadus morhua*

I'm at wit's end, I tried to read about substitute, expression, and eval functions in the hopes I can figure it out, but I am lost!

Thanks for any help!

Cheers,

-Jeremy N

Undergraduate Researcher in Macroecology University of Ottawa
Department of Biology

Ad astra per alia porci!

        [[alternative HTML version deleted]]



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. Received on Thu 31 Mar 2011 - 06:08:35 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 31 Mar 2011 - 13:00:26 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive