rStats.js v1.3.0
    Preparing search index...

    Function cbind

    • Combine vectors and matrices as columns. Equivalent to R's cbind(). Vectors are recycled to the number of rows. Given data frames (objects of columns), puts their columns side by side, as R's cbind() of data frames: all must have the same number of rows, and a column name may occur only once.

      Parameters

      Returns number[][]

      cbind([1, 2], [3, 4]);      // [[1, 3], [2, 4]]
      cbind([[1, 2], [3, 4]], 0); // [[1, 2, 0], [3, 4, 0]]
    • Combine vectors and matrices as columns. Equivalent to R's cbind(). Vectors are recycled to the number of rows. Given data frames (objects of columns), puts their columns side by side, as R's cbind() of data frames: all must have the same number of rows, and a column name may occur only once.

      Parameters

      Returns DataFrame

      cbind([1, 2], [3, 4]);      // [[1, 3], [2, 4]]
      cbind([[1, 2], [3, 4]], 0); // [[1, 2, 0], [3, 4, 0]]