diff --git a/xrdtf.R b/xrdtf.R index 297e836..bb78877 100644 --- a/xrdtf.R +++ b/xrdtf.R @@ -147,6 +147,7 @@ pdf2df <- function(pdffile) { # ApplicationVersion, # pdfNumber, # chemicalformula, + # empiricalformula, # wavelength # require(XML) @@ -187,6 +188,7 @@ pdf2df <- function(pdffile) { attr(angles, "ApplicationVersion") <- xmlAttrs(pdf)[[2]] attr(angles, "pdfNumber") <- xmlValue(pdf[["pdf_data"]][["pdf_number"]]) attr(angles, "chemicalformula") <- gsub("[ ]", "", xmlValue(pdf[["pdf_data"]][["chemical_formula"]])) + attr(angles, "empiricalformula") <- gsub("[ ]", "", xmlValue(pdf[["pdf_data"]][["empirical_formula"]])) attr(angles, "wavelength") <- as.numeric(xmlValue(pdf[["graphs"]][["wave_length"]])) # Caution: Do not subset. Subsetting causes all attributes to be lost. return(angles)