[R-SIG-Mac] 1) pdf output and 2) a "by" feature in R?

Denis Chabot chabotd at globetrotter.net
Sat Jul 17 12:48:18 CEST 2004


Hi,

I have started only recently using R and am still learning, however I 
managed to get some GAM analyses done, which was the main reason I 
started learning R in the first place.

I found out I could create pdf files directly when I created a large 
number of graphics in one session, instead of creating one or more 
quartz graph windows and saving them manually.

In Panther, there is no difference between the pdf files created by 
either method. They look beautiful in Preview, in Acrobat, inserted in 
LaTeX files for pdf output, everywhere but in Word documents(!) as one 
would expect.

But in Jaguar, pdf files created by outputing to a quarz window and 
saving manually, be it from R running on Jaguar or Panther, are fine. 
But those created by calling pdf, either on Panther or Jaguar, do not 
show any text when viewed with Jaguar's Preview, nor do they show any 
text when processed into a LaTeX document to a pdf file. I'm sorry that 
I have forgotten to print the pdf graphics or the LaTeX created pdf 
document to check whether the text was there. But I did check that both 
the pdf graphics file and the LaTeX created pdf document had all their 
text intact when viewed with Acrobat 6 under Jaguar.

It seems a glitch in Jaguar's Preview (maybe TeXShop's pdf viewer uses 
Preview's engine). But I'd like to know what is different between the 
pdf graphics created directly by calling pdf and those created by 
outputing to screen and saving manually.

My next question might be better asked in a R list instead of a R for 
Mac list. If so please forgive me and just tell me so. But since this 
list has been so helpful for me already, I will try here.

Stats package I have been using until now (recently this has been 
mostly JMP on my Mac and SAS at work, the latter thanks to the Citrix 
client for Mac as it is on a all-Windows network) have a "by" feature 
which I use a lot. I can take a file and calculate the mean, for 
example, of the abundance of a large number of prey items in cod 
stomachs, "by" subsets that could be cod size and year of sampling. The 
output can contain all possible combinations of the above (even 
intermediate results, such as 50-55 cm cod from all years) or just the 
most detailed subset (years by cod length categories, all pairwise). 
This table is then directly usable by me for many plots I need to 
produce.

I have not seen a "by" in R. It has no entry in "help". I have seen 
references to loops, but my knowledge of R is still too limited to 
imagine how I could ask an analysis like the above with loops. Am I 
missing the simple way in which this would be done in R, or is there no 
simple way? If, horror, the latter is true, is R a "fixed" language, 
new functionalities being provided exclusively by new packages, or is 
the language still evolving, in which case the addition of a "by" 
feature could be made (if I knew where to send it...)

Thanks in advance,

Denis Chabot
Bioenergetics researcher,
Institut Maurice-Lamontagne
Fisheries and Oceans Canada



More information about the R-SIG-Mac mailing list