Learn R Programming

onpoint (version 1.1)

balance_points: balance_points

Description

Balance number of points

Usage

balance_points(pattern, n, verbose = TRUE)

Value

ppp

Arguments

pattern

ppp object.

n

Either an integer or a ppp object.

verbose

Print messages.

Details

The function balances out the number of points in the input pattern to either the provided number of points as integer or the same number of points if a ppp object is provided.

Examples

Run this code
set.seed(42)
input <- spatstat.random::rpoispp(lambda = 100)
input_b <- spatstat.random::rpoispp(lambda = 100)

balance_points(pattern = input, n = 110)
balance_points(pattern = input, n = input_b)

Run the code above in your browser using DataLab