Best way to determine if ROS is installed

Wouldn’t it be possible to use environment variables? e.g. ROS_DISTRO