jumping.window: Jumping window

Description Usage Arguments Details Value Author(s) Examples

View source: R/jumping.window.R

Description

This function extracts a moving (a.k.a. running, rolling, sliding) window but with no overlap between windows and with the option for gaps between windows.

Usage

1
2
jumping.window(sampl.columns, window.size, gap.size, 
start.column = 1, J = FALSE)

Arguments

sampl.columns

index numbers of the consecutive columns with the sampling data (e.g. 3:180) from which to extract the jumping windows. Can also be any vector from which to extract a jumpting window.

window.size

size of each sampling window/season (consecutive sampling days each time)

gap.size

size of the gap between sampling windows. Can be zero or a positive integer.

start.column

column of sampl.columns where to actually start the sampling windows. The default is 1, but e.g. with a gap size of 1 between windows, the start column can be either 1 or 2.

J

logical, whether to provide the results in the form of J for function carcass::etterson. Defaults to FALSE.

Details

This function is now integrated within submatrix to provide for additional sampling scheme options.

Value

When J = FALSE (the default), this function returns a vector containing the elements of sampl.columns that are included in the extracted windows; elements falling within the gaps are left out.

Author(s)

A. Marcia Barbosa, J. Tiago Marques

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data(roadkills)

names(roadkills)

jumping.window(4:ncol(roadkills), window.size = 1, gap.size = 0)

jumping.window(4:ncol(roadkills), window.size = 1, gap.size = 1)

w3g5 <- jumping.window(4:ncol(roadkills), window.size = 3, 
gap.size = 5)

w3g5

AMBarbosa/DeadCanMove documentation built on Nov. 3, 2021, 10:03 a.m.