I am trying to code Directed Acyclic Graphs (DAGs) in Rstudio but keep getting the following error message:
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/V8/libs/V8.so':
dlopen(/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/V8/libs/V8.so, 0x0006): symbol not found in flat namespace '__ZNSt3__122__libcpp_verbose_abortEPKcz'
I am using the ggdag and tidyverse packages and have a mac. I have used Rstudio for over a year on my Mac and had no problems; however I completely deleted R, Rstudio, and any pertaining framework files on my computer and redownloaded them, yet the issue persists. I tried to download the V8 package in my computer terminal and link the path on Rstudio (using guidance from Chat GPT) but haven't had any luck so far.
Here is the first chunk of code where the error occurs:
# libraries
library(ggdag)
library(tidyverse)
#### fork
# code the fork structure
fork = dagify(
Y ~ X + Z,
X ~ Z,
exposure = "X",
outcome = "Y",
coords = list(
x = c(X = 0, Z = 0, Y = 1), # horizontal
y = c(X=0, Z= 1, Y=0) # vertical
)
)