Unlimited learning, half price | 50% off

Last chance! 50% off unlimited learning

Sale ends in


stplanr (version 0.2.4)

line_sample: Sample n points along lines with density proportional to a weight

Description

Sample n points along lines with density proportional to a weight

Usage

line_sample(l, n, weights)

Arguments

l

The SpatialLines object along which to create sample points

n

The total number of points to sample

weights

The relative probabilities of lines being samples

Examples

Run this code
# NOT RUN {
l = flowlines[2:5,]
n = 100
l_lengths = line_length(l)
weights = l$All
p = line_sample(l, 50, weights)
plot(p)
p = line_sample(l, 50, weights = 1:length(l))
plot(p)
# }

Run the code above in your browser using DataLab