Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Get osmolality data for common beverages
ResourceFunction["BeverageOsmolality"][] gives a structured Dataset of osmolality values for 40 common beverages. | |
ResourceFunction["BeverageOsmolality"][bev] gives the osmolality value for a single specified beverage. | |
ResourceFunction["BeverageOsmolality"][{bev1,bev2, …}] gives the osmolality values for a list of specified beverages. | |
ResourceFunction["BeverageOsmolality"][prop] gives a list of all beverages in the dataset with the associated value for the specified property. |
| "Data" | data associations instead of a dataset |
| "OsmolalityRules" | osmolality values as a list of rules |
| "EntityRules" | beverage entities as a list of rules |
Retrieve the dataset:
| In[1]:= |
| Out[1]= | ![]() |
Retrieve the data as an Association for each beverage:
| In[2]:= |
| Out[2]= | ![]() |
Retrieve the osmolality values for the full dataset as a list of rules:
| In[3]:= |
| Out[3]= | ![]() |
Retrieve the entities for the full dataset as a list of rules:
| In[4]:= |
| Out[4]= | ![]() |
Retrieve one or more specific beverages as a dataset:
| In[5]:= |
| Out[5]= | ![]() |
| In[6]:= |
| Out[6]= | ![]() |
Analyze the osmolality values for the full dataset:
| In[7]:= | ![]() |
| Out[7]= |
| In[8]:= | ![]() |
| Out[8]= |
When specifying multiple beverages, a message in the Messages box will advise which beverage items are missing, and only the ones available in the dataset will display:
| In[9]:= |
| Out[9]= | ![]() |
When specifying a single beverage, a message displays in the output and the Messages box when it is not available:
| In[10]:= |
| Out[10]= |
Plot the osmolality values for all beverages in the dataset:
| In[11]:= | ![]() |
| Out[12]= | ![]() |
Compare osmolality to the sugar, potassium and calories of the top 10 hypertonic beverages:
| In[13]:= | ![]() |
| Out[14]= | ![]() |
Now show the sugar, potassium and calorie charts associated to these beverages:
| In[15]:= |
| Out[15]= | ![]() |
Wolfram Language 13.0 (December 2021) or above
This work is licensed under a Creative Commons Attribution 4.0 International License