[R] Probably dumb question about lists

Rolf Turner r.turner at auckland.ac.nz
Thu Jan 15 00:10:53 CET 2015


I will add a "[.tile.list" method in the next release of deldir so that
the appropriate attributes are preserved.  This won't happen for a month 
or so though; I have some other pressures on me at the moment.

cheers,

Rolf Turner

On 15/01/15 04:52, Raphael Päbst wrote:
> Thanks Boris!
> I know that I am just leaving out some tiles in the plot, but I
> specifically want to drop those tiles for the plot and not calculate a
> tesselation without these points. So I'll go with this solution and
> hope it makes sense in the end.
>
> Thanks again!
>
> Raphael
>
> On 1/14/15, Boris Steipe <boris.steipe at utoronto.ca> wrote:
>> plot.tile.list() expects its argument to be of class tile.list, and to have
>> an attribute "rw", both of which are not conserved after subsetting. You can
>> do ...
>>
>>
>> if (!require(deldir)) {
>>    install.packages("deldir")
>>    library(deldir)
>> }
>> x <- rnorm(10)
>> y <- rnorm(10)
>> del <- deldir(x, y)
>> tl <- tile.list(del)
>>
>> tl2 <- tl[1:4]
>> class(tl2) <- "tile.list"
>> attr(tl2, "rw") <- attr(tl, "rw")
>> plot.tile.list(tl2)  # or just plot(tl2)
>>
>> BUT!
>> This doesn't really make sense because you are just "randomly" plotting some
>> tiles from the full triangulation, not plotting a triangulation with less
>> points. That would be:
>>
>> plot(tile.list(deldir(x[1:4], y[1:4])))

-- 
Rolf Turner
Technical Editor ANZJS
Department of Statistics
University of Auckland
Phone: +64-9-373-7599 ext. 88276
Home phone: +64-9-480-4619



More information about the R-help mailing list