Converting voltage to analog value with resistor

It's not done with one resistor, but two, forming a voltage divider:
https://learn.sparkfun.com/tutorials/voltage-dividers