x <- seq(0, 1000, length.out = 3000); y <- rnorm(3000)
res <- binData(x, y)
length(res$mean.x) # will be half of the original length
# Now try it with bin.ratio that does not divide into 3000
x <- seq(0, 1000, length.out = 3000); y <- rnorm(3000)
res <- binData(x, y, bin.ratio = 7)
length(res$mean.x)
Run the code above in your browser using DataLab