Skip to content

ExampleData

ExampleData serves the datasets bundled with Woxi. ExampleData[] lists the available types.

$ wo 'ExampleData[]'
{NetworkGraph}

ExampleData["type"] lists the entries of that type, each a {type, name} pair ready to be passed straight back in.

$ wo 'ExampleData["NetworkGraph"][[1]]'
{NetworkGraph, ZacharyKarateClub}

ExampleData[{"type", "name"}] is the data itself — for a network, a Graph.

$ wo 'EdgeCount[ExampleData[{"NetworkGraph", "ZacharyKarateClub"}]]'
78

A second argument selects one property instead.

$ wo 'ExampleData[{"NetworkGraph", "LesMiserables"}, "VertexCount"]'
77
$ wo 'ExampleData[{"NetworkGraph", "LesMiserables"}, "VertexList"][[1 ;; 3]]'
{Myriel, Napoleon, MlleBaptistine}

A dataset that is not bundled stays unevaluated rather than returning something made up.

$ wo 'ExampleData[{"NetworkGraph", "NoSuchNetwork"}]'
ExampleData[{NetworkGraph, NoSuchNetwork}]