I need to overlay a western hemisphere SpatialPolygonsDataFrame of Peru, with longitude (-81.3307,-68.65311) on a large RasterBrick of climate data (dim = 721 1440 14610) with longitude (-0.125,359.875). Of course this is not possible because the shapefile is on Atlantic view, the rasterbrick on Pacific view.
I first tried using rotate() to recenter the rasterbrick on atlantic view, but this is impossibly time-consuming.
I then found recenter() from the sp package. This works; the new Peru shapefile is in Pacific view. However, it's a SpatialPolygons only -- it looses the data I had in the SpatialPolygonsDataFrame of Peru. Is there any way to keep the data, or does another, similar function keep the data?