fhs: Freehand select

Description Usage Arguments Details Value Author(s) Examples

View source: R/fhs.r

Description

Freehand select

Usage

1
fhs(data, mark = TRUE, names = TRUE, ...)

Arguments

data

Data frame or matrix of co-ordinates. (x,y) co-ordinates for each point will be on rows. Rownames of selected points will be returned.

mark

Default TRUE. Predicate marking of selected points.

names

Default TRUE. If TRUE will return rownames of data frame with points within polygon. If FALSE will return logical vector.

...

Additional parameters passed to points.

Details

Freehand select function. First generate a 2D plot using R's plot function, then select gate region by left clicking. Close polygon by right clicking. The function will return the rownames of the enclosed points by the rownames of th co-ordinates given in data.

Value

Returns character vector of rownames of the selected points from data if names parameter is TRUE. If names is FALSE then a logical vector indicating whether points are in the polygon is returned.

Author(s)

Wajid Jawaid

Examples

1
2
3
4
5
6
7
## Not run: 
x <- cbind(1:10, 1:10)
rownames(x) <- 1:10
plot(x, pch = 16, col = "red")
fhs(x)

## End(Not run)

gatepoints documentation built on May 30, 2017, 8:25 a.m.