wrangle_and_slice: Wrangle input data for format required by simulation

Description Usage Arguments Value Examples

View source: R/git_wrangle.R View source: R/wrangle.R

Description

Wrangle input data for format required by simulation

Usage

1
2
wrangle_and_slice(start_year, end_year, inndata, focal_species,
  geoselect_native)

Arguments

start_year

Year of staring recording as introductions

end_year

Year of ending recording as introductions

inndata

data-frame with inndata comming from "get_inndata"

focal_species

The latin (canonical) name of the species

geoselect_native

A spatial.polygon.dataframe indicating the native distribution range of the species in epsg:4326

Value

A data.frame

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
setwd("~/temp") # simulation working directory
# Download example input files
get_inndata(serveradress="my-server-adress.no",datafolder="./data") # will take som time to load
download.file("https://ntnu.box.com/shared/static/kzgmsa898gcks57iacogpet1g2yue8ib.rds",
             "./data/geoselect_native_Esox_lucius.rds") # not yet procedures to draw this rigth from DB

inndata <- readRDS("./data/view_occurrence_by_event.rds")
geoselect_native <- readRDS("./data/geoselect_native_Esox_lucius.rds")
focal_species <- "Esox lucius"
mynewdata_aslist <- wrangle_and_slice(inndata=inndata,start_year=1970,end_year=2017)
mynewdata <- mynewdata_aslist[["data"]]

NINAnor/INVAFISH-sim documentation built on May 28, 2019, 1:54 p.m.