read.sdm: read/write sdm* object from/to a file

Description Usage Arguments Details Author(s) References Examples

Description

Read an sdm object from a file, or write it to a file.

Usage

1
2
3
read.sdm(filename,...)

write.sdm(x,filename,overwrite,...)

Arguments

filename

Filename (character)

x

a sdm object (e.g., sdmModels,sdmdata or sdmSetting)

overwrite

Logical. If TRUE, "filename" will be overwritten if it exists (default is FALSE)

...

additional arguments

Details

read.sdm function reads any files that has been writed by write.sdm. These functions use saveRDS and readRDS to write and read the sdm objects. Additional arguments ... pass to these functions. An sdmModels object is saved to a file with an extension of ".sdm". The file extensions for sdmdata and sdmSetting object are ".sdd", and "sds", respectively.

Author(s)

Babak Naimi

naimi@r-gis.net

https://www.r-gis.net/

https://www.biogeoinformatics.org

References

Naimi, B., Araujo, M.B. (2016) sdm: a reproducible and extensible R platform for species distribution modelling, Ecography, 39:368-375, DOI: 10.1111/ecog.01881

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 

file <- system.file("external/data.sdd", package="sdm")

d <- read.sdm(file)

d
# can be used to read sdm models (sdmModels) and sdmSettings as well.

write.sdm(d,'dataset') 
# extension is created for data, model and settings as .sdd, .sds, and .sdm respectively.

list.files(pattern='dataset')

## End(Not run)

Example output

Loading required package: sp
sdm 1.0-89 (2020-04-22)
class                                 : sdmdata 
=========================================================== 
number of species                     :  1 
species names                         :  species1 
number of features                    :  3 
feature names                         :  bc12, bc4, ndvi 
type                                  :  Presence-Absence 
has independet test data?             :  FALSE 
number of records                     :  50 
has Coordinates?                      :  TRUE 
character(0)

sdm documentation built on Nov. 12, 2021, 9:06 a.m.