'How can I use normalize isotopic ratios from a single study using CIAAWconsensus package

I want to use the package CIAAWconsensus by Juris Meija and Antonio Possolo, to normalize the isotopic ratios of the NIST SRM 981 to the reference isotope 207Pb. I get an error that I can not understand when I use the function normalize ratios:

library(CIAAWconsensus)
## Certified isotopic ratios in NIST SRM 981 (Value, standard uncertainty)
CertiRati.SRM.981 <- list(R.204.206 = c(0.059042, 0.000037/2),
                          R.207.206 = c(0.91464,  0.00033/2),
                          R.208.206 = c(2.1681,  0.0008/2))

## Ordering the data frame as requested by package
(dat <- data.frame(Study = 1:3, Year = rep(1991, 3), Author = rep('NIST', 3),
                   Outcome = c('204Pb/206Pb', '207Pb/206Pb', '208Pb/206Pb'),
                   Value = c(CertiRati.SRM.981[[1]][1],
                             CertiRati.SRM.981[[2]][1], 
                             CertiRati.SRM.981[[3]][1]),
                   Unc = c(CertiRati.SRM.981[[1]][2],
                           CertiRati.SRM.981[[2]][2], 
                           CertiRati.SRM.981[[3]][2]),
                   k_extra = rep(1, 3)))
#   Study Year Author     Outcome    Value      Unc k_extra
# 1     1 1991   NIST 204Pb/206Pb 0.059042 1.85e-05       1
# 2     2 1991   NIST 207Pb/206Pb 0.914640 1.65e-04       1
# 3     3 1991   NIST 208Pb/206Pb 2.168100 4.00e-04       1
## Atempt to normalize the ratios to the 207Pb
normalize.ratios(dat = dat, element = 'lead', ref.isotope = '207Pb')
# Error in dimnames(x) <- dn :
#    Length of 'dimnames' [2] not equal to array extent

The dataframe is created as indicated in the package's documentation but can not get around this. Any help will be much appreciated.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source