x is defined on line 3. selectMinY will only consider the index of the data point that has the minimum temperature in New York (line 4), and will return both channels x and y (and also text, for that matter).
Then on line 7 we override the y channel by the temperature in San Francisco, so we end up with the x channel being all the dates, the y channel being all the temperatures in SF, and the index being the one that gives the minimum temperature in NYC.