# NOT RUN {
## Segments for 10-fold randomised cross-validation:
cvsegments(100, 10)
## Segments with four objects, taken consecutive:
cvsegments(60, length.seg = 4, type = "cons")
## Incomplete segments
segs <- cvsegments(50, length.seg = 3)
attr(segs, "incomplete")
## Leave-one-out cross-validation:
cvsegments(100, 100)
## Leave-one-out with variable/unknown data set size n:
n <- 50
cvsegments(n, length.seg = 1)
## Data set with replicates
cvsegments(100, 25, nrep = 2)
## Note that rows 1 and 2 are in the same segment, rows 3 and 4 in the
## same segment, and so on.
# }
Run the code above in your browser using DataLab