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

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

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