The preceding code sets the projection system to the longitude and latitude and the GCS toWGS84. If we want to change the projection to any other layer's (shapefile's) projection insideCRS(), we can writeproj4string()to get the CRS of a new layer and then set it to that. For example, if we want to set the projection system of a layerato the projection system of layerb, we can do so simply by writing the following: