Skip to content

spreader

Tim Erickson edited this page Aug 27, 2019 · 4 revisions

Spreader

This plugin operates on an existing "tidy" dataset and makes a new, un-tidy "derived" dataset.

The classic use case is if you have a dataset like this:

station what value
SF      TEMP  65
SF      Pop   800
LA      TEMP  81
LA      Pop   7500

In fact, you want to "spread out" the columns, like this:

station  TEMP  Pop
SF        65    800
LA        81   7500

In spreader, you identify the dataset you want to spread, and then identify which attribute is the "type" (in our case, what, which contains the type of data that follow) and which is the "value" attribute (in our case, value). You can also, optionally, identify an attribute that holds the units of the numbers in value.

But there's more: to identify what values are constant—in this case, the values SF and LA—you have to promote that attribute, that is, drag station to the left in the hierarchy. Then every left-hand case will become a single case in the derived collection, with one column for each value—each right-hand case.

If it doesn't work properly despite having organized things, be sure to press the refresh button after you have the hierarchy set.

Notes:

  • The derived dataset does not update automatically. If you change the tidy dataset and want to see that reflected in the spread one, you have to redo the transformation.
  • If there are different units for the same type of data in the same dataset (e.g., some TEMPs are Fahrenheit and some are Celsius) no conversion is done. Yet.
Clone this wiki locally