I downloaded a digital elevation data set. The file is '.tif' format. I have loaded in R. But when I try to transform the coordinate reference system from long/latitude to local UTM, problems occur. The code and errors are presented as below.
dem=raster('srtm_58_04.tif')
proj4string(dem)="+proj=longlat +ellps=GRS80 +no_defs"
myproj="+proj=utm +zone=48 +north +datum=WGS84 +units=m +no_defs +ellps=WGS84 +towgs84=0,0,0"
library(rgdal)
datutm=spTransform(dem,CRS(myproj))
Error in spTransform(dem, CRS(myproj)) :
load package rgdal for spTransform methods
How can I solve this problem?