business-science / correlationfunnel

Speed Up Exploratory Data Analysis (EDA)
https://business-science.github.io/correlationfunnel/
Other
132 stars 25 forks source link

fix: Check `getThemeInfo` existence #10

Open h4rvey-g opened 1 month ago

h4rvey-g commented 1 month ago

In VS Code, loading correlationfunnel will raise error because of rstudioapi::getThemeInfo()

r$> library(correlationfunnel)
Error: package or namespace load failed for ‘correlationfunnel’:
 .onAttach failed in attachNamespace() for 'correlationfunnel', details:
  call: rstudioapi::getThemeInfo()
  error: This {rstudioapi} function is not currently implemented for VSCode.

While R extension in VS Code has supported some of rstudioapi functions, getThemeInfo() is not included. Add rstudioapi::hasFun("getThemeInfo") besides rstudioapi::isAvailable() will solve the error

r$> rstudioapi::isAvailable()
[1] TRUE

r$> rstudioapi::hasFun("getThemeInfo")
[1] FALSE