filter-columns

Removes one or more columns from a datatable. Removes those columns whose name contains specified text or matches a regular expression.

Matching and non-matching datatables are produced.

Arguments

Inputs:

data: The datatable from which the columns will be removed.

pattern: The string or a regular expression to be searched for within the column names. Regular expressions must be wrapped with / character (e.g. /.*/).

Output:

data: A datatable not containing the columns matching the string or regular expression.

complementary: A datatable containing only the columns matching the string or regular expression.

Possible use cases

  • Removing specific columns.

  • Creating a subset of columns to rename, such as finding all columns containing "date" and feeding them into the rename-columns adaptor to make them all start with "Date -" so that they sort together in a visualization.

Last updated