X <- ppp(c(1,1,0.5,1), c(2,2,1,2), window=square(3), check=FALSE)
m <- multiplicity(X)
# unique points in X, marked by their multiplicity
first <- !duplicated(X)
Y <- X[first] %mark% m[first]
Run the code above in your browser using DataLab