I'm trying to upload some of my analysis from R into ArcGIS but there isn't any coordinate points when I upload it. In my original CSV file I had coordinate points but lose them when I create a spatial dataframe???
#read csv file into r and then omit all the NAs
all_baboon <- read.csv(file = 'All_GPS_Collar_Data.csv')
baboon_GPS <- na.omit(all_baboon)
#create spatial dataframe by first creating new table with just individuals and x y coordinates
baboon.sp <- baboon_GPS[, c("Baboon", "X","Y")]
#create spatial points data frame
coordinates(baboon.sp) <- c("X", "Y")
str(baboon.sp)
#set coordinate referene system
proj4string(baboon.sp) <- CRS( "+proj=utm + zone=37 + datum=WGS84 +units=m +no_defs")
#calculate MCPs for each social group, 100% of points used in this scenario
baboon.mcp <- mcp(baboon.sp, percent=100)
baboon.mcp
I followed a tutorial for using adehabitat to find the home range of baboons. I can plot the home ranges in R, but haven't put a map down as the background because I want to import it as a shapefile into arcGIS. However, when I created a shapefile, theres no coordinates so the points and polygons don't get placed on the map.
shapefile(x = baboon.mcp, file = ".../baboonmcp.shp")
writeOGR(baboon.mcp, dsn = "...file_location", layer = "baboon.mcp", driver = "ESRI Shapefile")
I've tried it using shapefile and writeOGR but still have nothing. How can I add back the coordinates from the original csv file so it can be plotted in arcGIS?