[R] question on extracting binary data from pdf image

Prof Brian Ripley ripley at stats.ox.ac.uk
Mon Sep 8 18:47:41 CEST 2008


On Mon, 8 Sep 2008, Li, Xiaochun wrote:

> Dear List,
>
> If I use the following code to generate a pdf,
>
> pdf(filename)
> image(x, y, !is.na(z), col=c("green","black"))
> dev.off()
>
> Can someone extract the 0-1 data (that is, is.na(z)) from the Adobe source?

Yes (from the PDF file, which is not due to Adobe but R).  Indeed, a PDF 
viewer has to do that to show you the image.  In fact given the way R's 
pdf driver works it is rather easy to do.

>
> Thank you.
>
> Xiaochun
>
>
> 	[[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.
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-help mailing list