# Categorical

Categorical variables can be called by declaring `categorical: true` in your variable specification:

```javascript
    // ...variables
    {
        variable: "Most Common Heating Fuel",
        numerator: "household_data",
        nProperty: "Fuel Type",
        categorical: true,
        colorScale: colors.colorbrewer.Dark2,
    }
```

You can use any data properties for categorical data, but note that the map will search for exact matches to the data categories. Similarly, you can use any color scheme, although colorBrewer's [Qualitative Color Schemes](https://colorbrewer2.org/#type=qualitative\&scheme=Dark2\&n=6) (or similar) may be best suited for categorical variables.

Note that categorical variables will look for every unique value and assign it a color. For data columns or variables with a large number of unique values, this may not be the best option.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.webgeoda.org/variables/categorical-variables.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
