[R] Thinning Lattice Plot

Bert Gunter gunter.berton at gene.com
Tue Jul 31 15:32:25 CEST 2012


Well, yes.

Terminology-wise, I guess one could say that it's a trellis plot in
the Hmisc package.

But I'd agree that this is nitpicking.

-- Bert

On Tue, Jul 31, 2012 at 6:13 AM, Elliot Joel Bernstein
<elliot.bernstein at fdopartners.com> wrote:
> Thanks everyone for your replies. I didn't know about the ecdfplot
> function, so I'll start using that instead of Ecdf. Why is Ecdf not a
> lattice plot? The result certainly looks like other lattice plots, the
> arguments are similar to other lattice plots. In fact, internally it seems
> to just call the "histogram" function with a different prepanel and panel
> function. Is it not considered a lattice plot only because it isn't part of
> the lattice package?
>
> Thanks.
>
> - Elliot
>
> On Tue, Jul 31, 2012 at 2:32 AM, Deepayan Sarkar
> <deepayan.sarkar at gmail.com>wrote:
>
>> On Tue, Jul 31, 2012 at 2:43 AM, Elliot Joel Bernstein
>> <elliot.bernstein at fdopartners.com> wrote:
>> > Is there an easy way to "thin" a lattice plot? I often create plots from
>> > large data sets, and use the "pdf" command to save them to a file, but
>> the
>> > resulting files can be huge, because every point in the underlying
>> dataset
>> > is rendered in the plot, even though it isn't possible to see that much
>> > detail.
>> >
>> > For example:
>> >
>> > require(Hmisc)
>> > x <- rnorm(1e6)
>> >
>> > pdf("test.pdf")
>> > Ecdf(x)
>> > dev.off()
>>
>> (This is not a lattice plot, BTW.)
>>
>> > The resulting pdf files is 31MB.
>>
>> Hmm, for me it's 192K. Perhaps you have not bothered to update R recently.
>>
>> > Is there any easy way to get a smaller pdf
>> > file without having to manually prune the dataset?
>>
>> In general, as David noted, you need to do some sort of data
>> summarization; great if tools are available to that, otherwise
>> yourself. In this case, for example, it seems reasonable to do
>>
>> Ecdf(quantile(x, probs = ppoints(500, a=1)))
>>
>> If you don't like to do this yourself, ecdfplot() in latticeExtra will
>> allow
>>
>> library(latticeExtra)
>> ecdfplot(x, f.value = ppoints(500, a=1))
>>
>> -Deepayan
>>
>
>
>
> --
> Elliot Joel Bernstein, Ph.D. | Research Associate | FDO Partners, LLC
> 134 Mount Auburn Street | Cambridge, MA | 02138
> Phone: (617) 503-4619 | Email: elliot.bernstein at fdopartners.com
>
>         [[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.



-- 

Bert Gunter
Genentech Nonclinical Biostatistics

Internal Contact Info:
Phone: 467-7374
Website:
http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm



More information about the R-help mailing list