install.packages(“roxygen2”)

— Please select a CRAN mirror for use in this session —

Secure CRAN mirrors

1: 0-Cloud [https] 2: Algeria [https]

3: Australia (Canberra) [https] 4: Australia (Melbourne 1) [https]

5: Australia (Melbourne 2) [https] 6: Australia (Perth) [https]

7: Austria [https] 8: Belgium (Ghent) [https]

9: Brazil (PR) [https] 10: Brazil (RJ) [https]

11: Brazil (SP 1) [https] 12: Brazil (SP 2) [https]

13: Bulgaria [https] 14: Chile 1 [https]

15: Chile 2 [https] 16: China (Hong Kong) [https]

17: China (Guangzhou) [https] 18: China (Lanzhou) [https]

19: China (Shanghai 1) [https] 20: China (Shanghai 2) [https]

21: Colombia (Cali) [https] 22: Czech Republic [https]

23: Denmark [https] 24: East Asia [https]

25: Ecuador (Cuenca) [https] 26: Ecuador (Quito) [https]

27: Estonia [https] 28: France (Lyon 1) [https]

29: France (Lyon 2) [https] 30: France (Marseille) [https]

31: France (Montpellier) [https] 32: France (Paris 2) [https]

33: Germany (Erlangen) [https] 34: Germany (Göttingen) [https]

35: Germany (Münster) [https] 36: Greece [https]

37: Iceland [https] 38: India [https]

39: Indonesia (Jakarta) [https] 40: Ireland [https]

41: Italy (Padua) [https] 42: Japan (Tokyo) [https]

43: Japan (Yonezawa) [https] 44: Korea (Busan) [https]

45: Korea (Seoul 1) [https] 46: Korea (Ulsan) [https]

47: Malaysia [https] 48: Mexico (Mexico City) [https]

49: Norway [https] 50: Philippines [https]

51: Serbia [https] 52: Spain (A Coruña) [https]

53: Spain (Madrid) [https] 54: Sweden [https]

55: Switzerland [https] 56: Turkey (Denizli) [https]

57: Turkey (Mersin) [https] 58: UK (Bristol) [https]

59: UK (London 1) [https] 60: USA (CA 1) [https]

61: USA (IA) [https] 62: USA (KS) [https]

63: USA (MI 1) [https] 64: USA (NY) [https]

65: USA (OR) [https] 66: USA (TN) [https]

67: USA (TX 1) [https] 68: Uruguay [https]

69: Vietnam [https] 70: (other mirrors)

Selection: 60

trying URL ‘https://cran.cnr.berkeley.edu/bin/macosx/el-capitan/contrib/3.5/roxygen2_6.1.0.tgz’

# Content type ‘application/x-gzip’ length 712037 bytes (695 KB)

downloaded 695 KB

The downloaded binary packages are in

/var/folders/tt/vy5b7m5s7rb54r02c9r647tc0000gn/T//RtmpSKQcBX/downloaded_packages

Warning message:

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/Resources/modules//R_X11.so

Reason: image not found

quit()

SOlution > Just Install XQuartz from the link below and you dont need to set X11 as default server at all. It should fix your problem.