I have tried many things to eliminate the warnings and comments produced by the libraries with no success. Is there any thing that might do the trick? This is the last command i tried.
This will mean that the code to load the package will also not be included in the output. If you don't want that printed, that is a good option.
But, I am unable to reproduce the poster's original issue with the information given. When I use warning and message set to FALSE for a code chunk that calls library(dplyr), I don't see any warnings or messages printed.
But what the poster is seeing are lots of other warnings too (like for plotly). So I suspect these are produced by the call to the sourced .R script (which I cannot reproduce). You'll need to apply those code chunk options globally or at the least to the chunk that loads that .R script, which must load other packages and contain code that prints warnings and messages. For example, if I include this chunk in an R Markdown document:
Where myscript.R loads the dplyr package only, no warnings or messages are printed when I knit to HTML. You can also set these chunk options globally in a setup chunk so that they apply to all following code chunks, as shown here: