The following CNMAT and Wikipedia entries cover all the important explanations of why you need and how to place pull-up or pull-down resistors.
For most of our fabric sensors using
digitalWrite(14, HIGH); // set internal pullup resistor for analog pin 0
For setting the internal pull-up resistors for digital input pins, the code will look like the following.
digitalWrite(2, HIGH); // turn on internal pullup resistor for digital pin 2
The INPUT setting for all digital and analog pins is default, so it does not really need to be specified in the code like this:
pinMode(pin, INPUT); // set pin to input
There are various ways to wire or sew your pull-up resistors.