#Error google-chrome and chromium-browser were not found. Try setting the CHROMOTE_CHROME environment variable or adding one of these executables to your PATH.
Error in initialize(...) : Invalid path to Chrome
After a lot searching I figured out that on WSL Google chrome should be installed. After installing, Google Chrome, the problem was fixed.
Following is the code to be run in WSL terminal for installing Google Chrome.
# Download Google Chrome
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
# Install Google Chrome
sudo apt -y install ./google-chrome-stable_current_amd64.deb
# Check successful installation by checking the version of Google Chrome
google-chrome --version
Thereafter, just restart your RStudio project and try the code. Hopefully, it will be successfully.