[R-sig-eco] Writing Projected Shapefiles for R in ArcGIS

Stacy Bierwagen sbierwag at hawaii.edu
Wed Aug 20 22:34:19 CEST 2014


I had an earlier correspondence with someone on this list that I haven't
recently been able to contact. I am still having issues gluing a projection
on to the shapefiles I am writing from R regarding KUDs. Everytime I try to
load one onto ArcGIS it gives me a message saying the file is missing
spatial reference data so it won't overlay on to my map. I attached the
script, a head of my data, and the shapefile that I have exported from R.

If anyone sees anything I am doing wrong I would really appreciate it.

data <- read.table(file.choose(), header=T, na.strings=c("", "NA"),
sep="\t")
lapply(c('adehabitatLT','adehabitatHR','sp','rgdal'), library,
character.only=T)
#==convert data to spatial points dataframe
xy=data[9:10] # coords
df=data[-9:-10] # other data variables
spdf.x=SpatialPointsDataFrame(coords=xy,data=df)
#==Estimate utilization distribution
kud <-
kernelUD(spdf.x[,4],h="href",hlim=c(0,1000),same4all=T,kern='bivnorm')
ud.1=estUDm2spixdf(kud)
writeOGR(ud.1,"KUD",driver="ESRI Shapefile")
#==home range from UD using LSCV
home=getverticeshr(kud,percent=c(95))
proj4string(home)=CRS("+init=epsg:27573 +proj=utm +zone=11 +ellps=WGS84
+units=m +no_defs")
writePolyShape(home,"HOME")
-------------- next part --------------
Date	TimeGMT	DTHI	DTConvertHI	TConvertHI	Frequency	Signal	Gain (dB)	Latitude	Longitude	Diel
6/14/2013	59:59.7	06142013 23:59:59.719	06142013 13:59:59.719	14:00:00.000	63	71	6	21.4326	-157.79103	AM
6/14/2013	59:57.7	06142013 23:59:57.678	06142013 13:59:57.678	13:59:58.000	63	70	6	21.4326	-157.79103	AM
6/14/2013	59:56.7	06142013 23:59:56.658	06142013 13:59:56.658	13:59:57.000	63	73	6	21.4326	-157.79103	AM
6/14/2013	59:54.6	06142013 23:59:54.618	06142013 13:59:54.618	13:59:55.000	63	75	6	21.4326	-157.79103	AM
6/14/2013	59:53.6	06142013 23:59:53.598	06142013 13:59:53.598	13:59:54.000	63	73	6	21.4326	-157.79103	AM
6/14/2013	59:52.6	06142013 23:59:52.578	06142013 13:59:52.578	13:59:53.000	63	74	6	21.4326	-157.79103	AM
6/14/2013	59:51.6	06142013 23:59:51.558	06142013 13:59:51.558	13:59:52.000	63	78	6	21.4326	-157.79103	AM
6/14/2013	59:21.0	06142013 23:59:20.951	06142013 13:59:20.951	13:59:21.000	63	72	12	21.43263	-157.79091	AM
6/14/2013	59:19.9	06142013 23:59:19.932	06142013 13:59:19.932	13:59:20.000	63	70	12	21.43263	-157.79091	AM
6/14/2013	59:00.6	06142013 23:59:00.562	06142013 13:59:00.562	13:59:01.000	63	74	12	21.43262	-157.7908	AM
6/14/2013	58:58.5	06142013 23:58:58.522	06142013 13:58:58.522	13:58:59.000	63	80	12	21.43262	-157.7908	AM
6/14/2013	58:57.5	06142013 23:58:57.502	06142013 13:58:57.502	13:58:58.000	63	79	12	21.43262	-157.7908	AM
6/14/2013	58:56.5	06142013 23:58:56.482	06142013 13:58:56.482	13:58:56.000	63	82	12	21.43262	-157.7908	AM
6/14/2013	58:55.5	06142013 23:58:55.462	06142013 13:58:55.462	13:58:55.000	63	70	12	21.43262	-157.7908	AM
6/14/2013	58:48.3	06142013 23:58:48.324	06142013 13:58:48.324	13:58:48.000	63	75	12	21.43262	-157.7908	AM
6/14/2013	58:47.3	06142013 23:58:47.305	06142013 13:58:47.305	13:58:47.000	63	80	12	21.43262	-157.7908	AM


More information about the R-sig-ecology mailing list