R Under development (unstable) (2025-04-17 r88153 ucrt) -- "Unsuffered Consequences" Copyright (C) 2025 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > set.seed(0xBEEF) > > # Number of loci > J <- 1000 > > mu <- double(J) > mu[200:300] <- mu[200:300] + 1 > mu[350:400] <- NA_real_ # centromere > mu[650:800] <- mu[650:800] - 1 > eps <- rnorm(J, sd=1/2) > y <- mu + eps > x <- sort(runif(length(y), max=length(y))) * 1e5 > > knownSegments <- data.frame( + chromosome=c( 0, 0), + start =x[c( 1, 401)], + end =x[c(349, J)] + ) > > fit2 <- PSCBS::segmentByCBS(y, x=x, knownSegments=knownSegments) > > proc.time() user system elapsed 0.57 0.10 0.68