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

    Function fromRows

    • A data frame (an object of columns) from an array of row objects, the usual shape of JSON and of parsed CSV: [{ age: 30, score: 5 }, { age: 41, score: 7 }] becomes { age: [30, 41], score: [5, 7] }. A key that a row lacks, and undefined, become null (a missing value). Values must be numbers, strings, booleans or null, and one column may not mix numbers, strings and booleans. Not an R function. R reads data as data frames directly.

      Parameters

      • rows: readonly Readonly<Record<string, unknown>>[]
      • options: FromRowsOptions = {}

      Returns DataFrame

      fromRows([{ id: "a", score: 5 }, { id: "b" }]);   // { id: ["a", "b"], score: [5, null] }