Sir1
Sir1

Reputation: 742

Compile R package "arulesSequence" for older release

I want to use arulessequences for sequence mining. I have to use it in Oracle R distribution version R 3.3.0 (last released) and The problem is that the last version of the arulesSequences package is R >= 3.3.2. So I get an error for this problem:

Error: this is R 3.3.0, package arulesSequences needs >=3.3.2

So I decided to compile the source code for older release. I downloaded an older package that needs R 3.2.5 or above. And I know that this package is depended to arules. so I have installed it already. I used following instructions to compile the arulessequences package: in the source directory I run this command:

R CMD build arulesSequences the output of this command is:

c:\rr\arulesSequences_0.2-17>R CMD build arulesSequences
* checking for file 'arulesSequences/DESCRIPTION' ... OK
* preparing 'arulesSequences':
* checking DESCRIPTION meta-information ... OK
* cleaning src Warning in cleanup_pkg(pkgdir, Log) : unable to run 'make clean' in 'src'
* checking for LF line-endings in source and make files
* checking for empty or unneeded directories
* looking to see if a 'data/datalist' file should be added
* building 'arulesSequences_0.2-17.tar.gz'

a file named 'arulesSequences_0.2-17.tar.gz' get created but when I check it as below I get the following as output:

c:\rr\arulesSequences_0.2-17\arulesSequences>R CMD check arulesSequences
* using log directory 'c:/rr/arulesSequences_0.2-17/arulesSequences/arulesSequences.Rcheck'

  • using R version 3.4.0 (2017-04-21)
  • using platform: x86_64-w64-mingw32 (64-bit)
  • using session charset: ISO8859-1
  • checking for file 'arulesSequences/DESCRIPTION' ... OK
  • this is package 'arulesSequences' version '0.2-17'
  • checking package namespace information ... OK
  • checking package dependencies ... ERROR Package required but not available: 'arules'

See section 'The DESCRIPTION file' in the 'Writing R Extensions'
manual.
* DONE Status: 1 ERROR

I know the arules package is installed and I checked it. It seems the build process is not successful. do you have any idea to help solve this out?

Upvotes: 1

Views: 226

Answers (2)

Mahdi jahanbakht
Mahdi jahanbakht

Reputation: 66

You have to first install c/c++ compiler for R(called gcc) that is under R's additional build tools. to do that, in RStudio goto File->New File ->c++ File. It will show the following dialogue: enter image description here Then click on yes. to compile a package under windows, you have to set repo to Null and type to source. you can use this command to do that:

install.packages("SOURCEADDRESS",type="source",repo=null)

as @EugèneAdell mentioned above you have to first install arules. then arulessequences.

Upvotes: 2

Eugène Adell
Eugène Adell

Reputation: 3174

Instead of building, take the archive packages that seem to be ok for your R version and install them. On my Linux, this gives :

wget http://cran.univ-paris1.fr/src/contrib/Archive/arules/arules_1.5-0.tar.gz
R CMD INSTALL $HOME/arules_1.5-0.tar.gz
* installing to library ‘/home/ruser/R-3.2.5/lib64/R/library’
* installing *source* package ‘arules’ ...
...
** testing if installed package can be loaded
* DONE (arules)

wget http://cran.univ-paris1.fr/src/contrib/Archive/arulesSequences/arulesSequences_0.2-17.tar.gz
R CMD INSTALL $HOME/arulesSequences_0.2-17.tar.gz
* installing to library ‘/home/ruser/R-3.2.5/lib64/R/library’
* installing *source* package ‘arulesSequences’ ...
...
** testing if installed package can be loaded
* DONE (arulesSequences)

R
> library(arulesSequences)
Loading required package: arules
Loading required package: Matrix

Attaching package: ‘arules’

Maybe a more recent version for arules is possible, I just took the first one from the 1.5 series.

Upvotes: 1

Related Questions