Was this page helpful?

I put the data from two scans into different variables but they look the same. Why?

From $1

    Table of contents
    No headers

    The extmats such as RSS$scan.mat use persistent storage, so the following won't do what you expect:

    x <- RSS$scan.mat
    rss.process.one.scan()
    y <- RSS$scan.mat

    In fact, x and y refer to the same storage and so have the same data, which you can confirm by doing:

    all(x[] == y[])

    To get around this, you need to force conversion of the data to a native R matrix by using indexing like this:

    x <- RSS$scan.mat[]
    rss.process.one.scan ()
    y <- RSS$scan.mat[]

    The tendency for R to copy objects is one reason radR uses extmats for large matrices.





    Was this page helpful?
    Tags: (Edit tags)
    • No tags
     
    Comments (0)

     
    Powered by MindTouch Core