Matchrows

From Eigenvector Research Documentation Wiki
Revision as of 13:40, 9 June 2011 by imported>Jeremy
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Purpose

Matches up rows from two DataSet objects using labels or sizes.

Synopsis

[x,y] = matchrows(x,y)

Description

Given two input DataSet objects (x) and (y), MATCHROWS locates rows of (y) which match rows of (x) based on the labels in both objects and re-orders (y) to match (x). If (y) contains additional rows which match no rows of (x), they are dropped from (y). If some rows of (x) do not have matching (y) rows, the corresponding rows of (y) are filled in with NaN.

If no matching row labels are found, MATCHROWS searches other modes of x and y for matching labels. If no matching labels are found in any mode, sizes of the inputs are used to attempt a match. If no sizes match, an error is thrown.


The order of tests is:

  • All label sets on mode 1 of both x and y
  • All label sets on modes 2-k of y vs. mode 1 of x (transpose y)
  • All label sets on modes 2-k of y vs. modes 2-k of x (transpose x and y)
  • Number of y rows vs. number of x rows (no change)
  • Number of y columns vs. number of x rows (transpose y)
  • Number of y columns vs. number of x columns (transpose x and y) (where k is the number of modes of x or y) Multi-dimensional x and y are supported by all tests.

Outputs

Output DSOs are aligned (and possibly transposed) input DataSets.

alignmat, editds, matchvars, shuffle