SPSS Statistics

 View Only
Expand all | Collapse all

Can't install R package in version 28 on Mac M1 please help

  • 1.  Can't install R package in version 28 on Mac M1 please help

    Posted Fri March 10, 2023 09:20 AM

    Dear Community,

    I am running SPSS Statistics 28 on Mac OS M1 Ventura. Somehow the system don't let me install any R packages.

    I have spent already many days in searching for a solution on web, but without success. Hope you can help me out in this.

    I use the following command to install the package in R for Statistics:

    Install.packages("WRS2").

    Below I have attached the full error report / system output:

    Your help is much appreciated.

    Thank you in advance,

    Max


    * Project '~/Library/Application Support/IBM/SPSS Statistics/28/R40' loaded. [renv 0.13.2]

    > install.packages("WRS2")

    Installiere Paket nach '/Users/maxmba/Library/Application Support/IBM/SPSS Stati stics/28/R40/renv/library/R-4.0/x86_64-apple-darwin18.7.0'

    (da 'lib' nicht spezifiziert)

    installiere auch Abh"angigkeiten 'Rcpp', 'mvtnorm', 'reshape', 'plyr', 'mc2d'

    versuche URL 'https://cloud.r-project.org/src/contrib/Rcpp_1.0.10.tar.gz'

    Content type 'application/x-gzip' length 2936173 bytes (2.8 MB)

    ==================================================

    downloaded 2.8 MB

    versuche URL 'https://cloud.r-project.org/src/contrib/mvtnorm_1.1-3.tar.gz'

    Content type 'application/x-gzip' length 166421 bytes (162 KB)

    ==================================================

    downloaded 162 KB

    versuche URL 'https://cloud.r-project.org/src/contrib/reshape_0.8.9.tar.gz'

    Content type 'application/x-gzip' length 41843 bytes (40 KB)

    ==================================================

    downloaded 40 KB

    versuche URL 'https://cloud.r-project.org/src/contrib/plyr_1.8.8.tar.gz'

    Content type 'application/x-gzip' length 401438 bytes (392 KB)

    ==================================================

    downloaded 392 KB

    versuche URL 'https://cloud.r-project.org/src/contrib/mc2d_0.1-22.tar.gz'

    Content type 'application/x-gzip' length 1247956 bytes (1.2 MB)

    ==================================================

    downloaded 1.2 MB

    versuche URL 'https://cloud.r-project.org/src/contrib/WRS2_1.1-4.tar.gz'

    Content type 'application/x-gzip' length 490896 bytes (479 KB)

    ==================================================

    downloaded 479 KB

    * installing *source* package 'Rcpp' ...

    ** Paket 'Rcpp' erfolgreich entpackt und MD5 Summen "uberpr"uft

    ** using staged installation

    ** libs

    /Applications/IBM SPSS Statistics/Resources/R/lib/R/etc/Makeconf:10: /Applications/IBM: No such file or directory

    /Applications/IBM SPSS Statistics/Resources/R/lib/R/etc/Makeconf:10: SPSS: No such file or directory

    /Applications/IBM SPSS Statistics/Resources/R/lib/R/etc/Makeconf:10: Statistics/Resources/R/lib/R/share/make/vars.mk: No such file or directory

    make: *** No rule to make target `Statistics/Resources/R/lib/R/share/make/vars.mk'. Stop.

    ERROR: compilation failed for package 'Rcpp'

    * removing '/Users/maxmba/Library/Application Support/IBM/SPSS Statistics/28/R40/renv/library/R-4.0/x86_64-apple-darwin18.7.0/Rcpp'

    * installing *source* package 'mvtnorm' ...

    ** Paket 'mvtnorm' erfolgreich entpackt und MD5 Summen "uberpr"uft

    ** using staged installation

    ** libs

    /Applications/IBM SPSS Statistics/Resources/R/lib/R/etc/Makeconf:10: /Applications/IBM: No such file or directory

    /Applications/IBM SPSS Statistics/Resources/R/lib/R/etc/Makeconf:10: SPSS: No such file or directory

    /Applications/IBM SPSS Statistics/Resources/R/lib/R/etc/Makeconf:10: Statistics/Resources/R/lib/R/share/make/vars.mk: No such file or directory

    make: *** No rule to make target `Statistics/Resources/R/lib/R/share/make/vars.mk'. Stop.

    ERROR: compilation failed for package 'mvtnorm'

    * removing '/Users/maxmba/Library/Application Support/IBM/SPSS Statistics/28/R40/renv/library/R-4.0/x86_64-apple-darwin18.7.0/mvtnorm'

    ERROR: dependency 'Rcpp' is not available for package 'plyr'

    * removing '/Users/maxmba/Library/Application Support/IBM/SPSS Statistics/28/R40/renv/library/R-4.0/x86_64-apple-darwin18.7.0/plyr'

    ERROR: dependency 'mvtnorm' is not available for package 'mc2d'

    * removing '/Users/maxmba/Library/Application Support/IBM/SPSS Statistics/28/R40/renv/library/R-4.0/x86_64-apple-darwin18.7.0/mc2d'

    ERROR: dependency 'plyr' is not available for package 'reshape'

    * removing '/Users/maxmba/Library/Application Support/IBM/SPSS Statistics/28/R40/renv/library/R-4.0/x86_64-apple-darwin18.7.0/reshape'

    ERROR: dependencies 'reshape', 'plyr', 'mc2d' are not available for package 'WRS2'

    * removing '/Users/maxmba/Library/Application Support/IBM/SPSS Statistics/28/R40/renv/library/R-4.0/x86_64-apple-darwin18.7.0/WRS2'

    Die heruntergeladenen Quellpakete sind in

    '/private/var/folders/_l/cbt9llxj3yn2hwvx07smynp80000gn/T/RtmpUbcUTR/downloaded_packages'

    Warnmeldungen:

    1: In install.packages("WRS2") :

    Installation des Pakets 'Rcpp' hatte Exit-Status ungleich 0

    2: In install.packages("WRS2") :

    Installation des Pakets 'mvtnorm' hatte Exit-Status ungleich 0

    3: In install.packages("WRS2") :

    Installation des Pakets 'plyr' hatte Exit-Status ungleich 0

    4: In install.packages("WRS2") :

    Installation des Pakets 'mc2d' hatte Exit-Status ungleich 0

    5: In install.packages("WRS2") :

    Installation des Pakets 'reshape' hatte Exit-Status ungleich 0

    6: In install.packages("WRS2") :

    Installation des Pakets 'WRS2' hatte Exit-Status ungleich 0



    ------------------------------
    max xu
    ------------------------------


  • 2.  RE: Can't install R package in version 28 on Mac M1 please help

    Posted Mon March 13, 2023 11:00 AM
    Edited by max xu Tue March 14, 2023 11:15 AM

    Hi Max. Based upon the error shown above it looks like the C++ compiler doesn't like the spaces in the path to the R folders. See "/Applications/IBM SPSS Statistics/Resources/R/lib/R/etc/Makeconf", line 10. There it says:

    ## This fails if it contains spaces, or if it is quoted

    An unfortunate 'feature' in R.

    To work around it, you might try the following:

    1. Move the "/Applications/IBM SPSS Statistics/Resources/R" folder to something without spaces in the path
    2. Set the "R_HOME" environment variable to point to the new location.
    3. Set the "HOME" value in the "[R]" section of the "/Applications/IBM SPSS Statistics/SPSS Statistics.app/Contents/bin/spssdxcfg.ini" to also point to the new location.

    Let me know if this doesn't work for you.

    Best,



    ------------------------------
    Curtis Browning
    SPSS Statistics Architect
    ------------------------------



  • 3.  RE: Can't install R package in version 28 on Mac M1 please help

    Posted Tue March 14, 2023 09:12 AM

    Dear Curtis, many thank for your help on this. I have tried to creat a copy of "/Applications/IBM SPSS Statistics/Resources/R" to "/Applications/R" add this path with .libPaths function. But I do not know how to change the R_Home Environment in SPSS 28 on Mac ventura (can't find a good source on web either). Also I can't find a file on my computer called "spssdxcfg.ini". I have one more discovery in the meantime: I can't install any R packages on with SPSS Version 28 on mac and window. Same error message. But it do works on SPSS Version 29 on Windows notebook. On my mac i am already working with the administrator mdoe. Somehow I can't activate the SPSS Version 29 on my mac, if this works I will simply buy the version 29 for my mac OS. I have also tried to add the path "/Applications/IBM SPSS Statistics/Resources/R/lib/R/etc" where  Makeconf is located, but it does not change anything. Best, Max



    ------------------------------
    max xu
    ------------------------------



  • 4.  RE: Can't install R package in version 28 on Mac M1 please help

    Posted Tue March 14, 2023 09:51 AM

    Hi Max. Glad you were able to get R working in version 29. That is the best solution if we can get it working correctly for you. 

    I'm not clear though on where you are with this -

    1. Are you able to activate Statistics on your Windows notebook but not on your Mac?
    2. What error are you seeing on MacOS when you try to activate Statistics?
    3. May I assume you are working with the trial version of Stats 29? 

    For future reference, you can run Stats on MacOS with an environment variable by doing the following:

    1. Open a terminal window on your Mac
    2. Enter the following there: cd "/Applications/IBM SPSS Statistics/SPSS Statistics.app/Contents/MacOS"
    3. Export an environment variable. For example: export R_HOME=/Applications/R.
    4. Start Stats: ./stats

    There should be an spssdxcfg.ini file located on your system at:

    /Applications/IBM SPSS Statistics/SPSS Statistics.app/Contents/bin/spssdxcfg.ini.

    I should also note that the internal version of R that ships with Stats does not function properly when an external version of R is already installed on your MacOS system. This is because the act of installing R sets up a Mac to only use that version. Statistics 29.0.1 will not allow an internal version of R to be used on MacOS if an external version already exists at /Library/Frameworks/R.framework/Versions/4.2

    Regards,



    ------------------------------
    Curtis Browning
    SPSS Statistics Architect
    ------------------------------



  • 5.  RE: Can't install R package in version 28 on Mac M1 please help

    Posted Tue March 14, 2023 10:42 AM
    Edited by max xu Tue March 14, 2023 11:14 AM

    Dear Curtis, I really grateful for your help. Thank you for writting down the detailed steps for me. Yes. So far I tried to activate this only with the trial version, since I am not sure if this will also work with SPSS 29 on Mac OS. I got the message something like this "licence activation (via email account) failed. A different computer is active".I think the activation failed, because I have on my computer already version 28 installed - even I have uninstall the program beforehand. You are right the file spssdxcfg.ini. does really exist. I was only not able to find it. With "show package content" I can find the file. I did all the steps now. But somehow the program react strange now. I cannot run the side application "R for statistics" anymore. Also when I run the syntax editor now e.g. using the command 

    BEGIN PROGRAM R.
    .libPaths()
    END PROGRAM.

    the program shows nothing on output screen anymore.

    Do you think it is very likely I can install the R package on SPSS 29 on my MacOS? If yes, I will just buy the new version. I am reluctant so far, since I was not sure if it will work. Is there anyway to activate the trial version on my mac in my case? Just to test before I buy an additional SPSS version.

    1000 thanks for your help!

    Best,

    Max 



    ------------------------------
    max xu
    ------------------------------



  • 6.  RE: Can't install R package in version 28 on Mac M1 please help

    Posted Tue March 14, 2023 11:25 AM
    Edited by Curtis Browning Tue March 14, 2023 11:27 AM

    Hi Max,

    I just tried to install the WRS2 package on my Intel Macbook running Ventura 13.2.1, and it worked. Here's the log:

     
    BEGIN PROGRAM R. 
    print("Using R Version:") 
    version 
    print("Installing WRS2 package") 
    install.packages("WRS2") 
    print("Library paths:") 
    .libPaths() 
    END PROGRAM. 
    [1] "Using R Version:" 
                   _ 
    platform       x86_64-apple-darwin18.7.0 
    arch           x86_64 
    os             darwin18.7.0 
    system         x86_64, darwin18.7.0 
    status 
    major          4 
    minor          2.0 
    year           2022 
    month          04 
    day            22 
    svn rev        82229 
    language       R 
    version.string R version 4.2.0 (2022-04-22) 
    nickname       Vigorous Calisthenics 
    [1] "Installing WRS2 package" 
    Installing package into ‘/Users/curtisbrowning/Library/Application Support/IBM/SPSS Statistics/one/R42/renv/library/R-4.2/x86_64-apple-darwin18.7.0’ 
    (as ‘lib’ is unspecified) 
    also installing the dependency ‘mc2d’ 
    trying URL 'https://cloud.r-project.org/src/contrib/mc2d_0.1-22.tar.gz' 
    Content type 'application/x-gzip' length 1247956 bytes (1.2 MB) 
    ================================================== 
    downloaded 1.2 MB 
    trying URL 'https://cloud.r-project.org/src/contrib/WRS2_1.1-4.tar.gz' 
    Content type 'application/x-gzip' length 490896 bytes (479 KB) 
    ================================================== 
    downloaded 479 KB 
    The downloaded source packages are in 
    ‘/private/var/folders/p4/6h0b6y1s6hd46lvbb_gylsfw0000gn/T/RtmpfaRFv8/downloaded_packages’ 
    [1] "Library paths:" 
    [1] "/Users/curtisbrowning/Library/Application Support/IBM/SPSS Statistics/one/R42/renv/library/R-4.2/x86_64-apple-darwin18.7.0" 
    [2] "/Applications/IBM SPSS Statistics/Resources/R/lib/R/library" 
    [3] "/Applications/IBM SPSS Statistics/Resources/R/rpackage"

    Checking in "/Users/curtisbrowning/Library/Application Support/IBM/SPSS Statistics/one/R42/renv/library/R-4.2/x86_64-apple-darwin18.7.0" I see that both mc2d and WRS2 were installed.

    Best,



    ------------------------------
    Curtis Browning
    SPSS Statistics Architect
    ------------------------------



  • 7.  RE: Can't install R package in version 28 on Mac M1 please help

    Posted Tue March 14, 2023 11:32 AM

    Great. Then I will buy the Version 29 in addition. Fingers crossed that it works also on M1 :) Thank you so much!!! Best, Max



    ------------------------------
    max xu
    ------------------------------



  • 8.  RE: Can't install R package in version 28 on Mac M1 please help

    Posted Tue March 14, 2023 11:51 AM

    Dear Curtis, I have bought the SPSS Version 29 and installed it on my MacOS M1 Ventura. But unfortunately this is also not working. But neverthless, THANK YOU very much for your kind 1A support. Reall much appreciated. 

    Best,

    Max



    ------------------------------
    max xu
    ------------------------------



  • 9.  RE: Can't install R package in version 28 on Mac M1 please help
    Best Answer

    Posted Tue March 14, 2023 12:36 PM

    Happy to work with you directly Max to get it working. Feel free to email me at <brownicu@us.ibm.com> if you are interested in pursuing this further.

    Regards,



    ------------------------------
    Curtis Browning
    SPSS Statistics Architect
    ------------------------------



  • 10.  RE: Can't install R package in version 28 on Mac M1 please help

    Posted Tue March 14, 2023 03:41 PM

    Dear Curtis,

    I want to THANK YOU!!!! Thank you that you helped me to solve the issue offline. It is your advice to copy the relevant packages including the dependencies directly from https://cran.r-project.org/ into the r package folder  '/Users/myusername/Library/Application Support/IBM/SPSS Statistics/28/R40/renv/library/R-4.0/x86_64-apple-darwin18.7.0'

    After that running the install.package("WRS2"). Now everything works :))

    First class support!

    Sincere Thanks



    ------------------------------
    max xu
    ------------------------------