# NOT RUN {
# DSsim can generate a systematic set of parallel line transects which by default have a
# spacing of 100
design <- make.design("line")
# The easiest way to generate the transect is by creating a simulation (default simulations
#create a line transect design)
sim <- make.simulation()
transects <- generate.transects(sim)
plot(make.region())
plot(transects, col = 4, lwd = 2)
# DSsim can generate a systematic grid of point transects which by default have a spacing of 100
design <- make.design("point")
sim <- make.simulation(design.obj = design)
transects <- generate.transects(sim)
plot(make.region())
plot(transects)
# More complex designs can be defined in Distance for Windows. This software can then generate
# multiple survey instances and store them as shapefiles for use by DSsim. The shapefile below
# was generated in this way.
# }
# NOT RUN {
coords <- gaps <- list()
coords[[1]] <- list(data.frame(x = c(0,1000,1000,0,0), y = c(0,0,
1000,1000,0)))
gaps[[1]] <- list(data.frame(x = c(400,600,500,350,400), y = c(100,
250,600,120,100)))
region <- make.region(region.name = "study.area", units = "m",
coords = coords, gaps = gaps)
data(transects.shp)
#Edit the pathway below to point to an empty folder where the
#transect shapefile will be saved
shapefile.pathway <- "C:/..."
library(shapefiles)
write.shapefile(transects.shp, paste(shapefile.pathway,"/transects_1",
sep = ""))
# This design was created in Distance for Windows in a region with the same dimensions as the
# deault make.region().
parallel.design <- make.design(transect.type = "Line",
design.details = c("Parallel","Systematic"), region = region,
design.axis = 0, spacing = 100, plus.sampling =FALSE,
path = shapefile.pathway)
# As there is only one set of transects we have to set single.transect.set = TRUE
sim <- make.simulation(single.transect.set = TRUE, design.obj = parallel.design)
transects <- generate.transects(sim)
plot(region)
plot(transects, col = 4, lwd = 2)
# }
Run the code above in your browser using DataLab