I use code like this:

## UNTESTED
library(rgdal)
d <- readOGR("/path/to/file", "shpfile")

## use raster for an easy shortcut to build a clipping def
library(raster)
## dummy values,
ext <- extent(0, 100, 10, 90)
clipe <- as(ext, "SpatialPolygons")
proj4string(clipe) <- CRS(proj4string(d))
cropd <- SpatialPolygonsDataFrame(clipe, data.frame(x = 1), match.ID =
FALSE)

## Now do the clip
library(rgeos)
res <- gIntersection(d, cropd)


Now, for questions like this you should provide the code you are trying
with even if it doesn't work so we don't have to make it up.

Cheers, Mike.


On Wed, Sep 25, 2013 at 11:13 PM, Joseph Bechara <jbechara@lri-lb.org>wrote:

> Hello, ****
>
> ** **
>
> I’m trying to clip a shapefile with an extent.****
>
> Unfortunately it is not working.****
>
> Can somebody give me a hint?****
>
> ** **
>
> *JOSEPH BECHARA*
>
> *Wildfire Management Program Coordinator*
>
> Ashrafieh 1020 Building, 8th floor, Mathaf, Beirut, Lebanon**
>
> Tel.: +961 (1) 426630-1-2****
>
> Fax: +961 (1) 426631****
>
> Mail: jbechara@lri-lb.org <jbejjani@lri-lb.org>****
>
> www.lri-lb.org****
>
> [image: Description: Description: LRI-logo-Email]****
>
> ** **
>
> ** **
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
>


-- 
Michael Sumner
Hobart, Australia
e-mail: mdsumner@gmail.com

	[[alternative HTML version deleted]]

