Error when saving a table using gt::gtsave()

When I try to save the gt table within RStudio the following error is displayed. I am using the open source version of RStudio Server on WSL.

gt::gtsave(sod_cnflt_gt, filename = "sod_cnflt_gt.png")

#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

Can anyone guide, how to fix it?

2 Likes

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.

Note: For installing the Google Chrome, I took help from this article by Scott Spense

3 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.