Skip to content
Prev 18977 / 29559 Next

TR: Splitting the transect in to smaller segments

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:
--
Michael Sumner
Hobart, Australia
e-mail: mdsumner at gmail.com
Message-ID: <7422421DBB284141ACBF3EBFB07B46760148ACF73C36@ZZMAIL.newcefe.newage.fr>
In-Reply-To: <7422421DBB284141ACBF3EBFB07B46760148ACF73C35@ZZMAIL.newcefe.newage.fr>