# NOT RUN {
## The examples below will only be run if sufficient time is allowed
## You can change that by typing e.g. IsoriX.options(example_maxtime = XX)
## if you want to allow for examples taking up to ca. XX seconds to run
## (so don't write XX but put a number instead!)
if(IsoriX.getOption("example_maxtime") > 200) {
## We fit the models for Germany
GNIPDataDEagg <- prepdata(data = GNIPDataDE)
GermanFit <- isofit(iso.data = GNIPDataDEagg)
## We build the isoscape
isoscape <- isoscape(elevation.raster = ElevRasterDE,
isofit = GermanFit)
## We fit the calibration model
calib <- calibfit(calib.data = CalibDataAlien,
isofit = GermanFit)
## We perform the assignment on land only
assignment.dry <- isofind(assign.data = AssignDataAlien,
isoscape = isoscape,
calibfit = calib)
## perform the assignment on land and water
assignment <- isofind(assign.data = AssignDataAlien,
isoscape = isoscape,
calibfit = calib,
mask = NULL)
## We plot the group assignment
plot(assignment, who = "group", mask = list(mask = NULL))
plot(assignment.dry, who = "group", mask = list(mask = NULL))
## We plot the assignment for the 8 first individuals
plot(assignment.dry, who = 1:8,
sources = list(draw = FALSE),
calib = list(draw = FALSE))
## We plot the assignment for the individual "Alien_10"
plot(assignment.dry, who = "Alien_10")
### Other example without calibration:
### We will try to assign a weather station
### in the water isoscape
## We create the assignment data taking
## GARMISCH-PARTENKIRCHEN as the station to assign
GPIso <- GNIPDataDEagg[GNIPDataDEagg$stationID == "GARMISCH-PARTENKIRCHEN", "isoscape.value"]
AssignDataGP <- data.frame(tissue.value = GPIso,
animalID = "GARMISCH-PARTENKIRCHEN")
## We perform the assignment
assignment.GP <- isofind(assign.data = AssignDataGP,
isoscape = isoscape,
calibfit = NULL)
## We plot the assignment and
## show where the station really is (using lattice)
plot(assignment.GP) +
lattice::xyplot(47.48~11.06,
panel = lattice::panel.points,
cex = 5, pch = 13, lwd = 2, col = "black")
}
# }
Run the code above in your browser using DataLab