I reinstalled the Xcode last night and I tried the install.package ("testthat") through the Rstudio and Terminal. But I still got warning message like this:
Warning messages:
1: In doTryCatch(return(expr), name, parentenv, handler) :
unable to load shared object '/Library/Frameworks/R.framework/Resources/modules//R_X11.so':
dlopen(/Library/Frameworks/R.framework/Resources/modules//R_X11.so, 6): Library not loaded: /opt/X11/lib/libSM.6.dylib
Referenced from: /Library/Frameworks/R.framework/Versions/3.6/Resources/modules/R_X11.so
Reason: image not found
2: In install.packages("testthat") :
installation of package ‘digest’ had non-zero exit status
3: In install.packages("testthat") :
installation of package ‘rlang’ had non-zero exit status