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$
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, privacy policy and cookie policy

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