I'm encountering an issue when using the gtsave()
function from the gt
package to save a table as a PNG file. The error message suggests that it cannot find an available port to start Chrome. Here are the details:
library(gt)
library(dplyr)
mtcars %>%
head() %>%
gt() %>%
gtsave("test.png")
Error in with_random_port()
:
! Cannot find an available port. Please try again.
Caused by error in startup()
:
! Failed to start chrome. Error:
- ├─mtcars %>% head() %>% gt() %>% gtsave("test.png")
- └─gt::gtsave(., "test.png")
- └─gt:::gt_save_webshot(data = data, filename, path, ...)
-
└─webshot2::webshot(...)
-
└─chromote::default_chromote_object()
-
├─chromote::set_default_chromote_object(Chromote$new())
-
└─Chromote$new()
-
└─chromote (local) initialize(...)
-
└─Chrome$new()
-
└─chromote (local) initialize(...)
-
└─chromote:::launch_chrome(path, args)
-
└─chromote:::with_random_port(launch_chrome_impl, path = path, args = args)
Has anyone else encountered this issue? Any suggestions or workarounds would be greatly appreciated!
Thanks in advance for your help!