Installing sampleSelection Package

hello,
I've been trying to install the sampleSelection package on R studio without success inorder to run endogenous switching regression model. I am currently running R version 3.2.4. I uninstalled R and reinstalled from version 3.0.0 to 3.2.4. to find out if the problem was not related to the version of R on my pc but always get the following message:

>install.packages("sampleSelection")
Installing package into ‘C:/Users/baby/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
Warning: dependencies ‘VGAM’, ‘mvtnorm’ are not available

** There is a binary version available but the source version is later:**
** binary source needs_compilation**
sampleSelection 1.0-4 1.2-6 FALSE

installing the source package ‘sampleSelection’

trying URL 'https://rweb.crmda.ku.edu/cran/src/contrib/sampleSelection_1.2-6.tar.gz'
Content type 'application/x-gzip' length 3068830 bytes (2.9 MB)
downloaded 2.9 MB

ERROR: dependencies 'VGAM', 'mvtnorm' are not available for package 'sampleSelection'
*** removing 'C:/Users/baby/Documents/R/win-library/3.2/sampleSelection'**

The downloaded source packages are in
** ‘C:\Users\baby\AppData\Local\Temp\Rtmp2ZWDpq\downloaded_packages’**
Warning messages:
1: running command '"C:/PROGRA~1/R/R-32~1.4RE/bin/x64/R" CMD INSTALL -l "C:\Users\baby\Documents\R\win-library\3.2" C:\Users\baby\AppData\Local\Temp\Rtmp2ZWDpq/downloaded_packages/sampleSelection_1.2-6.tar.gz' had status 1
****2: In install.packages("sample
Selection") :**
** installation of package ‘sampleSelection’ had non-zero exit status**

Please I need help. I don't have a good knowledge of R

As the error message says, you are missing some package dependencies, you have to install those first. Also, I see you are using a very old R version, this is going to bring you a lot of troubles while installing packages, I would recommend you to update to the latest version (3.6.1)

Edit: You are not going to be able to install VGAM and mvtnorm in your current R version, they require R >= 3.4 and 3.5 respectively.

Thank you @andresrcs for your recommendation. Your comment is very helpful.

I finally succeeded in installing the sampleSelection package. The sampleSelection package depends on VGAM and mvtnorm which are under R 3.4.1 and R 3.5.0 respectively. Thus after instaling R 3.5.0, i installed the packages VGAM, mvtnorm and systemfit, miscTools, Ecdat to avoid the error i kept getting only after installing VGAM and mvtnorm.

Thereafter we can successfully > install.packages("sampleSelection")
but I did this before seeing your reply to my question.

As you recommended, i will update to the latest version of R 3.6.1
Thankyou

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.