take code from Heike to analyze nickel data
fix plot function and re-roxygenize