# 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") > 30) {
## We fit the models for Germany
GNIPDataDEagg <- prepdata(data = GNIPDataDE)
GermanFit <- isofit(iso.data = GNIPDataDEagg)
## We build the isoscapes
isoscape <- isoscape(elevation.raster = ElevRasterDE, isofit = GermanFit)
## We create a simulated dataset with 25 sites and 5 observations per site
Aliens <- create_aliens(calib_fn = list(intercept = 3, slope = 0.5, resid_var = 5),
isoscape = isoscape,
elevation_raster = ElevRasterDE,
n_sites = 25,
min_n_samples = 5,
max_n_samples = 5)
## We display the simulated dataset
Aliens
## We plot the relationship between the environmental isotope values
## and those from the simulated organisms
plot(tissue.value ~ env.value, data = Aliens, ylab = "Tissue", xlab = "Environment")
abline(3, 0.5, col = "blue") ## the true relationship
## We create a simulated dataset with 2 sites imputing coordinates manually
Aliens2 <- create_aliens(calib_fn = list(intercept = 3, slope = 0.5, resid_var = 5),
isoscape = isoscape,
coordinates = data.frame(siteID = c("Berlin", "Bielefeld"),
long = c(13.52134, 8.49914),
lat = c(52.50598, 52.03485)),
elevation_raster = ElevRasterDE,
n_sites = 25,
min_n_samples = 5,
max_n_samples = 5)
head(Aliens2)
}
# }
Run the code above in your browser using DataLab