Hi rajeobi, welcome to community!
First, it's best practice to reproduce your error with as a reprex (If you're not familiar with that; REPRoducible EXample (reprex)).
Second, your error message provides advice to resolve the issue. What happens after you follow that lead?
Specifically, the message:
If libxml-2.0 is already installed, check that 'pkg-config' is in your PATH and PKG_CONFIG_PATH contains a libxml-2.0.pc file. If pkg-config is unavailable you can set INCLUDE_DIR and LIB_DIR manually via: R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
Next, if the issue presists,
Some system Information could be useful as well
#### System Information:
- RStudio Edition: (Desktop or Server)
- RStudio Version:
- OS Version:
- R Version:
<!-- Depending on your issue, the following may be useful /-->
<!-- If a section isn't relevant or you can't collect it just delete that section below /-->
- RStudio diagnostics report: <!--see rstd.io/support-diagnostics-report /-->
- Your `sessionInfo()`:
- RStudio crash report: <!-- rstd.io/support-crash-report /-->
- RStudio application log files: <!-- rstd.io/support-ide-log-files /-->