3
$\begingroup$

I want a function that gives a list of all states adjacent to a given state. How can I do this in Mathematica?

$\endgroup$

1 Answer 1

5
$\begingroup$
f[x_] := AdministrativeDivisionData[x, "BorderingStates"]

Use:

f[{"California", "UnitedStates"}]

{Entity["AdministrativeDivision", {"Oregon", "UnitedStates"}], 
 Entity["AdministrativeDivision", {"Nevada", "UnitedStates"}], 
 Entity["AdministrativeDivision", {"Arizona", "UnitedStates"}]}
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.