The R code (for multiple regression analysis of near-infrared (NIR) spectra) and two data files (Y and X data for multiple regression, comprising NIR spectra a Loch Grannoch sediment record (Ys), and NIR spectra for a library of end-member materials (Xs). The sediment core is from Loch Grannoch in the Galloway Hills (SW Scotland). Loch Grannoch is a small (1.14 km2) upland (210 m O.D.) oligotrophic lake, with a granite bedrock (Cairnsmore of Fleet intrusion) (14 km2) catchment area. The Loch Grannoch core was sampled on 31 October 2016 from the central part of the lake (54.9954° N, 4.2832° W) from an anchored floating platform in ~16 m of water. The cores comprise 4 overlapping lengths sampled using a 0.075x1.5m capacity hand-percussive Russian corer. Cores were wrapped and sealed in polythene and stored refrigerated until required for analysis. Full details are in Russell et al. (submitted, Journal of Paleolimnology), NIRS quantification of lake sediment composition by multiple regression using end-member spectra. Procedures are described in annotations within the R code. FE Russell, JF Boyle, RC Chiverrell, Department of Geography and Planning, University of Liverpool. jfb@liv.ac.uk 3rd October 2018