Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Format a dataset using a given set of option values
ResourceFunction["FormatDataset"][rule1,…] represents an operator that applies the formatting options rulei to a Dataset. |
Apply formatting rules to a Dataset:
In[1]:= | ![]() |
Out[1]= | ![]() |
Create a Dataset:
In[2]:= | ![]() |
Out[2]= | ![]() |
Reformat it so that only three rows show and the background is cyan:
In[3]:= | ![]() |
Out[3]= | ![]() |
Apply a Query to data and format the results using the "Web" theme:
In[4]:= | ![]() |
Out[4]= | ![]() |
Apply a Query and use a postfix form of the function with iconized arguments to format the results using multiple styling options:
In[5]:= | ![]() |
Out[5]= | ![]() |
If the data to which the function is applied is not a Dataset to begin with, the function will convert it into a formatted Dataset:
In[6]:= | ![]() |
Out[6]= | ![]() |
Take data on executions in the United States:
In[7]:= | ![]() |
Out[7]= | ![]() |
Group the data by state, find the distribution of executed persons by race, reverse sort the states by total number of executions:
In[8]:= | ![]() |
Display the results of the query by showing just the 5 states with the highest number of executions, while using a "Monochrome" theme:
In[9]:= | ![]() |
Out[9]= | ![]() |
Highlight in lighter purple the number of Black persons executed:
In[10]:= | ![]() |
Out[10]= | ![]() |
One can store a format as a named variable and then deploy it on different datasets:
In[11]:= | ![]() |
In[12]:= | ![]() |
Out[12]= | ![]() |
In[13]:= | ![]() |
Out[13]= | ![]() |
One can create a function using FormatDataset that permits customization and experimentation with formats:
In[14]:= | ![]() |
In[15]:= | ![]() |
Out[15]= | ![]() |
The function compliments the resource function DatasetWithHeaders by permitting the results to be formatted:
In[16]:= | ![]() |
Out[16]= | ![]() |
This work is licensed under a Creative Commons Attribution 4.0 International License