Motivated by work of Ramanujan, Freeman Dyson defined the rank of an integer partition to be its largest part minus its number of parts. If N.m; n/ denotes the number of partitions of n with rank m, then it turns out thatWe show that if ¤ 1 is a root of unity, then R. I q/ is essentially the holomorphic part of a weight 1=2 weak Maass form on a subgroup of SL 2 ./ޚ. For integers 0 Ä r < t, we use this result to determine the modularity of the generating function for N.r; tI n/, the number of partitions of n whose rank is congruent to r .mod t /. We extend the modularity above to construct an infinite family of vector valued weight 1=2 forms for the full modular group SL 2 ,/ޚ. a result which is of independent interest.