chunk.bin {tripEstimation} | R Documentation |
~~ A concise (1-5 lines) description of what the function does. ~~
chunk.bin(filename, pimgs, weights = NULL, chunk = 2000, proj = NULL)
filename |
~~Describe filename here~~ |
pimgs |
~~Describe pimgs here~~ |
weights |
~~Describe weights here~~ |
chunk |
~~Describe chunk here~~ |
proj |
~~Describe proj here~~ |
~~ If necessary, more details than the description above ~~
~Describe the value returned If it is a LIST, use
comp1 |
Description of 'comp1' |
comp2 |
Description of 'comp2' |
...
....
~~further notes~~
~Make other sections like Warning with section{Warning }{....} ~
~~who you are~~
~put references to the literature/web site here ~
~~objects to See Also as help
, ~~~
##---- Should be DIRECTLY executable !! ---- ##-- ==> Define data, use random, ##-- or do help(data=index) for the standard data sets. ## The function is currently defined as function (filename, pimgs, weights = NULL, chunk = 2000, proj = NULL) { con <- file(filename, open = "rb") dm <- readBin(con, "integer", 3) cnt <- round(seq(0, 100, length = dm[3]/chunk)) i <- 1 cat("\n") repeat { n <- dm[1] * dm[2] * as.integer(chunk) A <- readBin(con, "double", n) m <- as.integer(length(A)/(dm[1] * dm[2])) if (m == 0) break A <- array(A, c(dm[-3], m)) if (!is.null(proj)) A[,1:2,] <- apply(A[,1:2,], 3, function(x) project(x, proj)) pimgs <- behav.bin(A, pimgs, weights = weights) cat(cnt[i], "...\n", sep = "") i <- i + 1 } cat("\n") close(con) pimgs }