Reputation: 59575
Let us have an extent object:
> require(raster)
> e <- extent(0,20,35,60)
> e
class : Extent
xmin : 0
xmax : 20
ymin : 35
ymax : 60
xmin(e)
, ymin(e)
.... ?EDIT: I actually needed this for saving the extent of drawExtent
for further use to construct the extent
:
> catalunya <- drawExtent()
> catalunya
class : Extent
xmin : -0.3026625
xmax : 4.399662
ymin : 39.4917
ymax : 43.55101
> dput(c(t(bbox(catalunya))))
c(-0.302662510572699, 4.39966213295851, 39.4917044713409, 43.5510057541513
Copy and paste this as a parameter to extent() to my script. DONE.
Upvotes: 2
Views: 3413
Reputation: 59575
> require(sp)
> bbox(e)
min max
s1 0 20
s2 35 60
Bbox can be also used to create extent object:
> extent(bbox(e))
class : Extent
xmin : 0
xmax : 20
ymin : 35
ymax : 60
Upvotes: 3