chunk.bin {tripEstimation}R Documentation

~~function to do ... ~~

Description

~~ A concise (1-5 lines) description of what the function does. ~~

Usage

chunk.bin(filename, pimgs, weights = NULL, chunk = 2000, proj = NULL)

Arguments

filename ~~Describe filename here~~
pimgs ~~Describe pimgs here~~
weights ~~Describe weights here~~
chunk ~~Describe chunk here~~
proj ~~Describe proj here~~

Details

~~ If necessary, more details than the description above ~~

Value

~Describe the value returned If it is a LIST, use

comp1 Description of 'comp1'
comp2 Description of 'comp2'

...

Warning

....

Note

~~further notes~~

~Make other sections like Warning with section{Warning }{....} ~

Author(s)

~~who you are~~

References

~put references to the literature/web site here ~

See Also

~~objects to See Also as help, ~~~

Examples

##---- 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
  }

[Package tripEstimation version 0.0-24 Index]