Somewhat hard for me to decipher what you're trying to do, but couldn't you
?elide your object?

Cheers,
Roman



On Wed, Sep 12, 2012 at 2:24 AM, Nick Matzke <matzke@berkeley.edu> wrote:

> Hi -- I am trying to change the coordinates of the points in a polygon
> (after shrinking the polygon towards the centroid.
>
> However, any way I try it (direct assignment, slot(), attr()), I get this
> error:
>
> =================
> object of type 'S4' is not subsettable
> =================
>
>
> Here's an example of the error, showing the objects I'm using.  Any help
> **much** appreciated.
>
> ===========================
>
>
> >                               class(all_emerged_islands_at_**
> this_height_break)
> [1] "SpatialPolygons"
> attr(,"package")
> [1] "sp"
> >                               all_emerged_islands_at_this_**height_break
> An object of class "SpatialPolygons"
> Slot "polygons":
> [[1]]
> An object of class "Polygons"
> Slot "Polygons":
> [[1]]
> An object of class "Polygon"
> Slot "labpt":
> [1] 91.44457 25.55424
>
> Slot "area":
> [1] 0.25305
>
> Slot "hole":
> [1] FALSE
>
> Slot "ringDir":
> [1] 1
>
> Slot "coords":
>            x      y
>  [1,] 91.273 25.804
>  [2,] 91.348 25.817
>  [3,] 91.408 25.844
>  [4,] 91.498 25.831
>  [5,] 91.528 25.763
>  [6,] 91.573 25.694
>  [7,] 91.633 25.681
>  [8,] 91.723 25.681
>  [9,] 91.768 25.626
> [10,] 91.768 25.544
> [11,] 91.768 25.448
> [12,] 91.708 25.380
> [13,] 91.648 25.312
> [14,] 91.558 25.298
> [15,] 91.468 25.298
> [16,] 91.378 25.325
> [17,] 91.318 25.380
> [18,] 91.228 25.421
> [19,] 91.123 25.435
> [20,] 91.108 25.558
> [21,] 91.123 25.640
> [22,] 91.198 25.708
> [23,] 91.258 25.776
> [24,] 91.273 25.804
>
>
>
> Slot "plotOrder":
> [1] 1
>
> Slot "labpt":
> [1] 91.44457 25.55424
>
> Slot "ID":
> [1] "89"
>
> Slot "area":
> [1] 0.25305
>
>
> [[2]]
> An object of class "Polygons"
> Slot "Polygons":
> [[1]]
> An object of class "Polygon"
> Slot "labpt":
> [1] 92.00535 25.12364
>
> [...etc...]
>
>
> >
> >                               class(tmppoly_shrunken)
> [1] "Polygon"
> attr(,"package")
> [1] "sp"
> >                               tmppoly_shrunken
> An object of class "Polygon"
> Slot "labpt":
> [1] 91.44457 25.55424
>
> Slot "area":
> [1] 25.29848
>
> Slot "hole":
> [1] FALSE
>
> Slot "ringDir":
> [1] 1
>
> Slot "coords":
>              x        y
>  [1,] 89.72883  3.00000
>  [2,] 90.47883 28.18185
>  [3,] 91.07883 28.45185
>  [4,] 91.97883 28.32185
>  [5,] 92.27883 27.64185
>  [6,] 92.72883 26.95185
>  [7,] 93.32883 26.82185
>  [8,] 94.22883 26.82185
>  [9,] 94.67883 26.27185
> [10,] 94.67883 25.45185
> [11,] 94.67883 24.49185
> [12,] 94.07883 23.81185
> [13,] 93.47883 23.13185
> [14,] 92.57883 22.99185
> [15,] 91.67883 22.99185
> [16,] 90.77883 23.26185
> [17,] 90.17883 23.81185
> [18,] 89.27883 24.22185
> [19,] 88.22883 24.36185
> [20,] 88.07883 25.59185
> [21,] 88.22883 26.41185
> [22,] 88.97883 27.09185
> [23,] 89.57883 27.77185
> [24,] 89.72883 28.05185
>
> >
> >                        slot(all_emerged_islands_at_**
> this_height_break[j]@polygons[**[1]]@Polygons[[1]], "coords",
> check=FALSE) = slot(tmppoly_shrunken, "coords")
> Error in slot(all_emerged_islands_at_**this_height_break[j]@polygons[**[1]]@Polygons[[1]],
>  :
>   object of type 'S4' is not subsettable
> >
> >
> ===========================
>
>
> --
> ==============================**======================
> Nicholas J. Matzke
> Ph.D. Candidate, Graduate Student Researcher
>
> Huelsenbeck Lab
> Center for Theoretical Evolutionary Genomics
> 4151 VLSB (Valley Life Sciences Building)
> Department of Integrative Biology
> University of California, Berkeley
>
> Graduate Student Instructor, IB200B
> Principles of Phylogenetics: Ecology and Evolution
> http://ib.berkeley.edu/**courses/ib200b/<http://ib.berkeley.edu/courses/ib200b/>
> http://phylo.wikidot.com/
>
>
> Lab websites:
> http://ib.berkeley.edu/people/**lab_detail.php?lab=54<http://ib.berkeley.edu/people/lab_detail.php?lab=54>
> http://fisher.berkeley.edu/**cteg/hlab.html<http://fisher.berkeley.edu/cteg/hlab.html>
> Dept. personal page: http://ib.berkeley.edu/people/**
> students/person_detail.php?**person=370<http://ib.berkeley.edu/people/students/person_detail.php?person=370>
> Lab personal page: http://fisher.berkeley.edu/**cteg/members/matzke.html<http://fisher.berkeley.edu/cteg/members/matzke.html>
> Lab phone: 510-643-6299
> Dept. fax: 510-643-6264
>
> Cell phone: 510-301-0179
> Email: matzke@berkeley.edu
>
> Mailing address:
> Department of Integrative Biology
> 1005 Valley Life Sciences Building #3140
> Berkeley, CA 94720-3140
>
> ------------------------------**-----------------------
> "[W]hen people thought the earth was flat, they were wrong. When people
> thought the earth was spherical, they were wrong. But if you think that
> thinking the earth is spherical is just as wrong as thinking the earth is
> flat, then your view is wronger than both of them put together."
>
> Isaac Asimov (1989). "The Relativity of Wrong." The Skeptical Inquirer,
> 14(1), 35-44. Fall 1989.
> http://chem.tufts.edu/**AnswersInScience/**RelativityofWrong.htm<http://chem.tufts.edu/AnswersInScience/RelativityofWrong.htm>
>
> ______________________________**_________________
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/**listinfo/r-sig-geo<https://stat.ethz.ch/mailman/listinfo/r-sig-geo>
>



-- 
In God we trust, all others bring data.

	[[alternative HTML version deleted]]

