Robert F. Kennedy Jr. formally announced on Tuesday that he was choosing wealthy attorney and entrepreneur Nicole Shanahan as his running mate.