The code runs fine and the PDF comes out nicely, but I am constantly getting a warning message printed to the PDF. I have tried everything: warning = FALSE, message = FALSE, suppressWarnings(), options(warn = -1), all of it. Before I even run the MK test, I remove subsets with less than 4 observations and then I also apply suppressWarnings() to the test, but I can't get the warning message to stop printing.
Code chunk settings as follows:
{r, echo=FALSE, warning = FALSE, message = FALSE, results = 'asis', fig.align= "center", fig.width = 7, fig.height = 5}
Lots of other code in between...then:
TSP_well_analyte = split(analytical_subset$ValidationResult_, analytical_subset$Analyte) #Creates groups of data based on analyte for MK analysis
TSP_well_analyte_short = TSP_well_analyte[lengths(TSP_well_analyte)>=4] #Remove less than 4 for MK analysis
mk_results = suppressWarnings(lapply(TSP_well_analyte_short, function(y) unlist(MannKendall(y)))) #Applies MK analysis by groups, stores all MK stats
mk_df = as.data.frame(mk_results) #Saves as a data frame for calling in stats
PDF runs fine but prints the following warning, which I have to then go in and delete manually with Adobe Acrobat:
WARNING: Error exit, tauk2. IFAULT = 12
My goal is to make this script fully automated (no manual editing to PDF), so any insight would be most appreciated; I've been driving myself crazy over it.