sl: Calculate slopes of PE curve

Description Usage Arguments Details Value Note Author(s) References See Also Examples

Description

This is used inside the pe function to calculate the slopes between points and make sure they are in increasing order

Usage

1
sl(df, pos)

Arguments

df

df is a dataframe with two columns: the x and y values to calculate PE

pos

the position of the points you want to calculate the slope on (starts at 2)

Details

No more details

Value

returns TRUE or FALSE. TRUE means slopes are unsorted and there is a problem; FALSE means they are sorted and there is no problem

Note

none

Author(s)

Alienor Chauvenet

References

none

See Also

none

Examples

1
2
3
4
5
6
7
8
9
x<-runif(10,1,100)
y<-runif(10,1,100)
# unsorted so returns TRUE:
sl(data.frame(x=x,y=y),c(2:length(x)))

# sorted so returns FALSE:
xs<-seq(1,100,10)
ys<-seq(1,50,5)
sl(data.frame(x=xs,y=ys),c(2:length(xs)))

AChauvenet/ProtectEqual documentation built on May 5, 2019, 11:28 a.m.