Learn R Programming

SDMtune (version 0.1.0)

mergeSWD: Merge SWD Objects

Description

Merge two '>SWD object.

Usage

mergeSWD(swd1, swd2)

Arguments

swd1

'>SWD object.

swd2

'>SWD object.

Value

The merged '>SWD object.

Details

In case the two '>SWD objects have different columns, only the common columns are used in the merged object.

Examples

Run this code
# NOT RUN {
# Acquire environmental variables
files <- list.files(path = file.path(system.file(package = "dismo"), "ex"),
                    pattern = "grd", full.names = TRUE)
predictors <- raster::stack(files)

# Prepare presence locations
p_coords <- condor[, 1:2]

# Create SWD object
presence <- prepareSWD(species = "Vultur gryphus", coords = p_coords,
                       env = predictors, categorical = "biome")

# Split presence locations in training (80%) and testing (20%) datasets
datasets <- trainValTest(presence, test = 0.2)
train <- datasets[[1]]
test <- datasets[[2]]

# Merge the training and the testing datasets together
merged <- mergeSWD(train, test)
# }

Run the code above in your browser using DataLab