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


1 Answer 1

f[x_] := AdministrativeDivisionData[x, "BorderingStates"]


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

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

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.