I am working on, with the Animal Weights
data set and creating MyFunction
which calculates the Max,Min,Mean,Median and first quartile. Then a apply the function to the data set and show it as a menu with MenuView
. My question is, is there a possible way to use add the calculation name in the data set object? Like in the image below.
ResourceObject["Sample Data: Animal Weights"];
dataset = ResourceData["Sample Data: Animal Weights"];
MyFunction[dataset_] :=
{Max[dataset], Min[dataset], Mean[dataset], Median[dataset],
Quantile[dataset, 0.25]}
MenuView[{"BodyWeight" -> dataset[MyFunction, "BodyWeight"],
"BrainWeight" -> dataset[MyFunction, "BrainWeight"]}]