While Loop Through String Python Documentation Functions In R