findBare: findBare

Description Usage Arguments Details Value Examples

View source: R/findBare.R

Description

Shows is a vector is related to bare/fallow land..

Usage

1
findBare(x, y)

Arguments

x

A numeric vector.

y

A numeric element.

Details

The function computes the amplitude of x and returns TRUE if this value is below the threshold given by y.

Value

A logical element.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
{

# vectors to test
x1 <- c(0.1,0.2,0.1,0.2,0.4,0.6,0.8,0.4,0.1) # simulated, crop profile
x2 <- c(0.1,0.3,0.2,0.2,0.1,0.3,0.1,0.2,0.2) # simulated, non-crop profile

# compare profiles
plot(x1, type="l")
lines(x2, col="red")

findBare(x1, 100) # returns TRUE
findBare(x2, 100) # returns FALSE

}

CAWaR documentation built on July 8, 2020, 7:06 p.m.