Skip to content
Snippets Groups Projects
Select Git revision
  • gh-pages
  • main default protected
  • round-parameter
  • fix-smd-selected-names
  • fn-rework
  • v0.3
  • v0.3.4-dev
  • v0.4.2
  • v0.4.1
  • v0.4.0
  • v0.3.4
  • v0.3.3
  • v0.3.2
13 results

RFSurrogates

  • Clone with SSH
  • Clone with HTTPS
  • Florian Gärber's avatar
    Gärber, Florian authored
    This PR fixes an issue where the result of `var.relations` would contain
    long runs of NA starting in the latter half of variables. This issue
    caused mean adjusted agreements to be shifted horizontally and across
    following rows.
    
    The issue was caused by setting the mean adjusted agreement of a
    variable with itself to NA incorrectly. Instead of using the current
    index, the variable index was used. This resulted in cells being
    incorrectly overwritten as NA if the variable index was smaller than the
    number of all variables, and in the implicit addition of NA beyond the
    end of the vector until the variable index when the variable index was
    larger than the number of all variables.
    
    This caused `mean.index` to return vectors with a length not exactly
    equal to the number of variables, which in the following steps caused an
    overrun when the concatenated vectors were being cast to a matrix with
    dimensions being exactly the length of all variables by all candidate
    variables. A warning message would appear when this occurred: `data
    length [...] is not a sub-multiple or multiple of the number of rows
    [...]`. It did not however notify that extra data was dropped
    implicitly.
    
    This PR also contains some basic test cases for the internal
    `mean.index` to prevent regression of this issue.
    - Assert that the length of the return value is always exactly as long
    as the number of variables
    - Assert that for unknown variables (that is, variables not represented
    in `list.res` or `index.variables`) the function will return an NA
    vector of the appropriate length.
    9c66e3c1
    History
    Name Last commit Last update