The link between star formation and gas in nearby galaxies