The two Rogers-Ramanujan $q$-series \[ \sum_{n=0}^{\infty}\frac{q^{n(n+\sigma)}}{(1-q)\cdots (1-q^n)}, \] where $\sigma=0,1$, play many roles in mathematics and physics. By the Rogers-Ramanujan identities, they are essentially modular functions. Their quotient, the Rogers-Ramanujan continued fraction, has the special property that its singular values are algebraic integral units. We find a framework which extends the Rogers-Ramanujan identities to doubly-infinite families of $q$-series identities. If $a\in\{1,2\}$ and $m,n\geq 1$, then we have \[ \sum_{\substack{\lambda \lambda_1\leq m}} q^{a|\lambda|} P_{2\lambda}(1,q,q^2,\dots;q^n) =\textrm{"infinite product modular function"}, \] where the $P_{\lambda}(x_1,x_2,\dots;q)$ are Hall-Littlewood polynomials. These $q$-series are specialized characters of affine Kac--Moody algebras. Generalizing the Rogers-Ramanujan continued fraction, we prove in the case of $\textrm{A}_{2n}^{(2)}$ that the relevant $q$-series quotients are integral units.