Observations of comet C/2016 R2 (PanSTARRS) have revealed exceptionally bright emission bands of N2+, the strongest ever observed in a comet spectrum. Alternatively, it appears to be poor in CN compared to other comets, and remarkably depleted in H2O. Here we quantify the N2 production rate from N2+ emission lines using the Haser model. We derived effective parent and daughter scalelengths for N2 producing N2+. This is the first direct measurement of such parameters. Using a revised fluorescence efficiency for N2+, the resulting production rate of molecular nitrogen is inferred to be Q(N2) ~ 1 ×1028 molecules.s-1 on average for 11, 12, and 13 Feb. 2018, the highest for any known comet. Based on a CO production rate of Q(CO) ~ 1.1 ×1029 molecules.s-1, we find Q(N−2)/Q(CO)~0.09, which is consistent with the N2+/CO+ ratio derived from the observed intensities of N2+ and CO+ emission lines. We also measure significant variations in this production rate between our three observing nights, with Q(N2) varying by plus or minus 20% according to the average value