[R-sig-Geo] TR: Splitting the transect in to smaller segments

Ravichandra MONDRETI Ravichandra.MONDRETI at cefe.cnrs.fr
Tue Jul 30 15:13:45 CEST 2013


I am sorry for the distortion. Here is the original data which consists of spatial point (Long-Lat) representing the beginning position of each transect of length 20km. Now I want to split each transect in to multiple 3km segments and test for spatial auto correlation. 

Obs	    Lat	                   Long              Number 
1	12,80382	82,44553	56
2	12,77357	82,67792	1
3	12,74253	82,8775	0
4	12,7118	83,08733	0
5	12,68468	83,28215	90
6	12,64768	83,49067	31
7	12,61173	83,723	                0
8	12,58148	83,92935	0
9	12,553	                84,16293            91
10	12,51517	84,37533	0
11	12,48025	84,60193	0
12	12,45202	84,83365	1
13	12,03108	87,61216	3
14	11,99813	87,83575	0
15	11,96863	88,05197	0
16	11,93698	88,27583	130
17	11,90938	88,49937	0
18	11,87682	88,69888	0
19	11,8452	88,90217	127
20	11,8116	89,13405	0
21	11,77802	89,35748	1
22	11,74482	89,57783	0
23	11,70103	89,94217	0
24	11,32148	92,42758	0
25	11,33478	92,68475	0
26	11,51452	92,78533	0

rm(list=ls())
# Library to load
library(sp)
library(adehabitat)
library(adehabitatHR)
library(adehabitatHS)
library(adehabitatLT)
library(adehabitatMA)
library(rgdal)
library(fields)
library(shapefiles)
library(maptools)
library(rgdal)
library(gpclib)
gpclibPermit()

setwd("C:\\Users\\mondreti\\Desktop\\Rworkdir")

# Data to load
BOBMDSOTE<- read.csv("C:\\Users\\mondreti\\Desktop\\Rworkdir\\BOBMD_SOTE1.csv", sep= ";", header=T)

# Inspect column headings
head(BOBMDSOTE)

# Telling R that BOBMDSOTE data frame consists spatial data	
coordinates(BOBMDSOTE)<- c("Latitude", "Longitude")
Class(BOBMDSOTE)
str(BOBMDSOTE)
x<- BOBMDSOTE$Latitude
y<- BOBMDSOTE$Longitude

xy.spdf <- SpatialPointsDataFrame(xy.sp, BOBMDSOTE)
summary(xy.spdf)
dimensions(xy.spdf)
xy.spdf

-------------------
After this I am unable to proceed.  Please help me with the code.

Thanks in advance,
Ravi.


-----Message d'origine-----
De : Michael Sumner [mailto:mdsumner at gmail.com] Envoyé : mardi 30 juillet 2013 11:47 À : Ravichandra MONDRETI Cc : r-sig-geo at r-project.org Objet : Re: [R-sig-Geo] Splitting the transect in to smaller segments

Could you put your data together in a reproducible way? It looks like this might just be the raw contents of a text file?

If you have it in R use dput() to create the code that will regenerate your object.



On Tue, Jul 30, 2013 at 7:37 PM, Ravichandra MONDRETI <Ravichandra.MONDRETI at cefe.cnrs.fr> wrote:
>
> Hello All,
>
> My data are counts of seabirds and marine mammals at a spatial scale of 20 Km i.e I had recorded the position of the ship at the beginning of every 20 Km transect. Now I want to split each 20km transect in to 3km segments to check for spatial autocorrelation among the observations and relate it to the oceanographic features. I had tried with packages sp and rgdal but was not arrive at the r code. Could anyone suggest me how to proceed with this problem?
>
> My data looks like this:
>
>     Latitude
>
>         Longitude
>
> 12,80382
>
> 82,44553
>
> 12,77357
>
> 82,67792
>
> 12,74253
>
> 82,8775
>
> 12,7118
>
> 83,08733
>
> 12,68468
>
> 83,28215
>
> 12,64768
>
> 83,49067
>
> 12,61173
>
> 83,723
>
> 12,58148
>
> 83,92935
>
> 12,553
>
> 84,16293
>
> 12,51517
>
> 84,37533
>
> 12,48025
>
> 84,60193
>
> 12,45202
>
> 84,83365
>
> 12,03108
>
> 87,61216
>
> 11,99813
>
> 87,83575
>
> 11,96863
>
> 88,05197
>
> 11,93698
>
> 88,27583
>
> 11,90938
>
> 88,49937
>
> 11,87682
>
> 88,69888
>
>
> Thanks in advance,
> Ravichandra Mondreti.
>
>
> Ravichandra Mondreti
> PhD student/ Doctorant
> MAHEVA Fellow (ERASMUS MUNDUS programme) Spatial Population Ecology 
> Team CEFE-CNRS 1919, route de Mende
> F-34293 Montpellier Cedex 05
> France
>
>
>
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo



--
Michael Sumner
Hobart, Australia
e-mail: mdsumner at gmail.com


More information about the R-sig-Geo mailing list