[R] Probably dumb question about lists

Bert Gunter gunter.berton at gene.com
Wed Jan 14 16:13:45 CET 2015


1. Please in future specify the package (deldir here) that contains
the functions you refer to.

2. **Always** first try ?str before posting queries like this, as this
will often reveal the problem.

str(tl[1:800])

3. I would **guess** (ergo could well be wrong) that "[" is not
preserving the class attribute of tl. Ergo you are getting the basic
plot method and not the plot.tile.list method.

HTH.

Cheers,

Bert

Bert Gunter
Genentech Nonclinical Biostatistics
(650) 467-7374

"Data is not information. Information is not knowledge. And knowledge
is certainly not wisdom."
Clifford Stoll




On Wed, Jan 14, 2015 at 6:23 AM, Raphael Päbst <raphael.paebst at gmail.com> wrote:
> Hello everybody!
> I feel very stupid right now but suspect it has something to do with
> tiredness. I am trying to drop the last couple of Elements from a list
> and this doesn't work as expected.
>
> My code looks something like this:
>
> del <- deldir(x, y)
> tl <- tile.list(del)
> plot(tl)
>
> Now, I only want to plot the first 800 elements of tl and can't work
> out how to do this.
> plot(tl[1:800])
> gives me an error "x is a list but does not have components x and y"
> which somewhat baffles me. I'm sure this is all due to lack of sleep
> but right now I feel very dumb and would welcome any pointers towards
> a solution for my problem.
>
> Many thanks!
>
> Raphael
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.



More information about the R-help mailing list