I am quite new to working with spatial dataframes, and have what I thought was a relatively simple task: take a dataframe of 6 points, with x and y columns representing the lat/long positions of those points, and project them so that they can be used in a spatial data frame that I have made.
Here is the way I coded in the 6 points:
d1 <- structure(list(latitude = c(37.427733, 37.565759, 37.580956, 37.429285, 37.424270, 37.502496), longitude = c(-108.011061, -107.814039, -107.676662, -107.677166, -108.898826, -108.586042)))
d2 <- as.data.frame(d1)
d3 <- SpatialPointsDataFrame(c(d2[,c('longitude','latitude')]), data = d2)
And I tried changing/assigning a projection for these (these lat/long data were taken from Google Maps), but I can't seem to make it work. The projection for the data I want to overlay these points on is the following:
+proj=aea +lat_0=23 +lon_0=-96 +lat_1=29.5 +lat_2=45.5 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs
So basically my question is, how can I convert these lat/long into the format for x/y that this projection uses? Here is the extent of the dataset I want to overlay it on for reference, showing that it is clearly not in simple lat/long:
class : Extent
xmin : -1145835
xmax : -1011345
ymin : 1613205
ymax : 1704855
Thank you all so much in advance!