chaisemartinPackages / did_multiplegt_dyn

|| Stata | R || Estimation of event-study Difference-in-Difference (DID) estimators in designs with multiple groups and periods, and with a potentially non-binary treatment that may increase or decrease multiple times.
23 stars 6 forks source link

R installation: package not working after installation #33

Closed hchulkim closed 1 month ago

hchulkim commented 1 month ago

Hi I recently installed the package and tried to use it. However, when I enter "library(DIDmultiplegtDYN)", I get this error:

Error in dyn.load(dynlib <- getDynlib(dir)) : unable to load shared object '/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/rgl/libs/rgl.so': dlopen(/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/rgl/libs/rgl.so, 0x0006): Library not loaded: /opt/X11/lib/libGLU.1.dylib Referenced from: <6C210E20-FA0B-304C-910C-E12EC6DBD711> /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/rgl/libs/rgl.so Reason: tried: '/opt/X11/lib/libGLU.1.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/X11/lib/libGLU.1.dylib' (no such file), '/opt/X11/lib/libGLU.1.dylib' (no such file), '/Library/Frameworks/R.framework/Resources/lib/libGLU.1.dylib' (no such file), '/Library/Java/JavaVirtualMachines/jdk-11.0.18+10/Contents/Home/lib/server/libGLU.1.dylib' (no such file), '/var/folders/w3/4q_kcbzd0gbb_950m6621zfw0000gn/T/rstudio-fallback-library-path-1226627117/libGLU.1.dylib' (no such file) Error: package or namespace load failed for ‘DIDmultiplegtDYN’: .onLoad failed in loadNamespace() for 'rgl', details: call: rgl.init(initValue, onlyNULL) error: OpenGL is not available in this build In addition: Warning messages: 1: Loading rgl's DLL failed. This build of rgl depends on XQuartz, which failed to load. See the discussion in https://stackoverflow.com/a/66127391/2554330 2: Trying without OpenGL...

I was wondering if this is some issue that is happening to other ppl or just some specific issue that I am just having. Thank you.

chaisemartinPackages commented 1 month ago

Hello, Thanks for your interest in did_multiplegt_dyn! From your traceback, it seems that the installation error may be related to Java. For this reason, I would suggest trying to install the no_xlsx version of DIDmultiplegtDYN. You can check out the installation procedure from the R (no_xlsx) paragraph of the Setup section in the README file. Let me know if this solves the issue. Best, Diego

hchulkim commented 1 month ago

Hi, Thanks for your reply! I did try the no_xlsx version but it seems it gives me exactly same error as I use library(DIDmultiplegtDYN):

` Error in dyn.load(dynlib <- getDynlib(dir)) : unable to load shared object '/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/rgl/libs/rgl.so': dlopen(/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/rgl/libs/rgl.so, 0x0006): Library not loaded: /opt/X11/lib/libGLU.1.dylib Referenced from: <6C210E20-FA0B-304C-910C-E12EC6DBD711> /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/rgl/libs/rgl.so Reason: tried: '/opt/X11/lib/libGLU.1.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/X11/lib/libGLU.1.dylib' (no such file), '/opt/X11/lib/libGLU.1.dylib' (no such file), '/Library/Frameworks/R.framework/Resources/lib/libGLU.1.dylib' (no such file), '/Library/Java/JavaVirtualMachines/jdk-11.0.18+10/Contents/Home/lib/server/libGLU.1.dylib' (no such file), '/var/folders/w3/4q_kcbzd0gbb_950m6621zfw0000gn/T/rstudio-fallback-library-path-9346593/libGLU.1.dylib' (no such file) Error: package or namespace load failed for ‘DIDmultiplegtDYN’: .onLoad failed in loadNamespace() for 'rgl', details: call: rgl.init(initValue, onlyNULL) error: OpenGL is not available in this build In addition: Warning messages: 1: Loading rgl's DLL failed. This build of rgl depends on XQuartz, which failed to load. See the discussion in https://stackoverflow.com/a/66127391/2554330 2: Trying without OpenGL... '

Not sure if this is sth with my personal computer setting. I am using mac OS sonoma btw. Sorry for the inconvenience.

chaisemartinPackages commented 1 month ago

I think that the traceback contains an hint: the last line redirects to a Stack Overflow post where they discuss this error: https://stackoverflow.com/a/66127391/2554330 Apparently, it's an issue from XQuartz on MacOS. In the link, there is a step-by-step guide to the solution. Unfortunately, I use Windows and Linux, so I cannot test the procedure myself. Please let us know if this fix works for you, other users may have the issue. Best, Diego

hchulkim commented 1 month ago

Thank you! I think I solved the problem. It seems you just had to install XQuartz again to make it work. Now it works fine thank you.