Example in the book

Observed occurrences (spatial point pattern):

d
## Simple feature collection with 267 features and 0 fields
## Geometry type: POINT
## Dimension:     XY
## Bounding box:  xmin: 490.8569 ymin: 7638.96 xmax: 1326.867 ymax: 8781.667
## Projected CRS: +proj=utm +zone=19 +south +ellps=GRS80 
##             +towgs84=0,0,0,0,0,0,0 +units=km +no_defs
## # A tibble: 267 × 1
##              geometry
## *        <POINT [km]>
## 1 (534.2615 8169.871)
## 2 (630.0663 8280.917)
## 3 (630.0663 8280.917)
## 4 (603.2193 8269.153)
## 5 (899.8398 8071.581)
## # ℹ 262 more rows
coo <- st_coordinates(d)
(n <- nrow(coo))
## [1] 267