This is a tool use to scrape Xpert HPV pdf reports and return the data as a formatted data frame of S3 class xpert_results.
The current package is not published to CRAN. You must install from github:
install.packages("remotes")
remotes::install_github("iluvdata/HPVScrape")Alternatively using pak:
install.packages("pak")
pak::pkg_install("iluvdata/HPVScrape")To parse a pdf (which can contain multiple results) simple create a new Xpert object. You can pass either a path or a raw vector of the pdf binary.
# Use OlsonNames() for a list of valid time zones
xpert <- Xpert("myXpertResults.pdf", "America/New_York")To parse a pdf first create a TZ object mapping the Xpert Instrument Serial Numbers to correct time zones.
tz <- TZ$new("110016067" = "America/Sao_Paulo", "110016068" = "America/Mexico_City")
xpert <- Xpert("myXpertResults.pdf", tz)myResults <- xpert$getResults()To get the PDF for a row in the data frame returned from Xpert$getResults() just pass the row number to Xpert$getPDFs(). The second argument is a path to the output file
pathToPDF <- xpert$getPDFs(2, "myResults.pdf")GPL-3