How can I list functions related to a specific function in a notebook without opening the documentation center? Sometimes I think I have the right function and have trouble remembering similar functions that will do the job. For example, when I think of Tuples but need Subsets instead, it would be helpful to print out all the functions under See Also. This would also help with the process of learning about new functions.
2 Answers
$\begingroup$
$\endgroup$
1
You can use the Entity
framework:
Entity["WolframLanguageSymbol","Tuples"]["RelatedSymbols"] //CommonName
{"Outer", "Array", "IntegerDigits", "Permutations", "Subsets", "Groupings", "Distribute"}
-
$\begingroup$ +1 Or as a pure function,
help := CommonName[Entity["WolframLanguageSymbol", ToString[#]]["RelatedSymbols"]] &;
$\endgroup$ Commented Dec 3, 2021 at 21:26
$\begingroup$
$\endgroup$
In addition to Carl's solution, you can explore the relationships by plotting the connections between symbols by crawling the documentation:
docCrawler[startSymbol_, depth_] :=
Flatten[Rest[
NestList[
Union[Flatten[
Thread[# ->
CommonName[
Entity["WolframLanguageSymbol", #][
"RelatedSymbols"]]] & /@ Last /@ #]] &, {"" ->
startSymbol}, depth]]];
Display this as a Graph
(of given depth)
edges = docCrawler["Tuples", 3];
which yields
Graph[edges, VertexLabels -> "Name"]