`subgraphMining` package not available - r

Was unable to install the package ‘subgraphMining’. The error says "is not available (for R version 3.4.3)". What steps are needed?

There is a package named subgraphMining which you can find by searching with Google using that term. (It's not a CRAN or Github hosted package.) It's found at a book website, http://www.csc.ncsu.edu/faculty/samatova/practical-graph-mining-with-R/PracticalGraphMiningWithR.html . It does require an additional package named igraph0 and there is an answered question on SO describing that issue. The igraph0 package is likewise not "available" for the current version of R but it is in the CRAN archives. So you also need the development tools for your OS (Mac in my case, so XCode and the Command Line Tools).
siteURL <- "https://www.csc2.ncsu.edu/faculty/nfsamato/practical-graph-mining-with-R/R-code/FrequentSubgraphMining.zip"
# Since I'm not a windoze user I unzip to a local disk.
install.packages("https://cran.r-project.org/src/contrib/Archive/igraph0/igraph0_0.5.7.tar.gz",
repo=NULL, type="source")
# I downloaded the package from the chapter: Frequent Subgraph Mining
install.packages("~/Downloads/FrequentSubgraphMining/subgraphMining_1.0.tar.gz",
repo=NULL, type="source")
library(subgraphMining)
It's not written particularly well. It doesn't, for instance, list any Imports or Depends in the package DESCRIPTION file and the author of igraph thinks that the package authors should have rewritten it to use the igraph package which is currently maintained. But I think that there is quite a bit of potential value in having its installation be possible in support of what appears to be a rather interesting set of methods described in hte book.

Related

Make CRAN R package suggest GitHub R package

I want to use the R package BOLTSSIRR available on GitHub in my R package, which I want to upload to CRAN.
I listed BOLTSSIRR under Suggests: in the DESCRIPTION file and made the link to GitHub available using Additional_repositories: https://github.com/daviddaigithub/BOLTSSIRR.
However, running R CMD check --as-cran I get:
Suggests or Enhances not in mainstream repositories:
BOLTSSIRR
Availability using Additional_repositories specification:
BOLTSSIRR no ?
? ? https://github.com/daviddaigithub/BOLTSSIRR
Additional repositories with no packages:
https://github.com/daviddaigithub/BOLTSSIRR
So the GitHub link does not seem to get recognized in the check. Might I have to change something here?
As you found, you can't use Remotes in a CRAN package. What you need to do is to make sure the .tar.gz file for the package you are depending on is available somewhere. Github doesn't do that automatically, because https://github.com/daviddaigithub/BOLTSSIRR isn't set up as a package repository.
The solution is to create your own small repository, and keep copies of non-CRAN packages there. The drat package (available here: https://github.com/eddelbuettel/drat) makes this easy as long as you have a Github account: follow the instructions here: https://github.com/drat-base/drat. In summary:
Fork https://github.com/drat-base/drat into your account, and clone it to your own computer.
Enable Github Pages with the docs/ folder in the main branch.
Install the drat package into R using remotes::install_github("eddelbuettel/drat"). (I assume this version will make it to CRAN eventually; if you use the current CRAN version instructions are slightly more complicated.)
Build the package you want to insert. You need the source version; you might want binaries too, if those are hard for your users to build.
Run options(dratBranch="docs"); drat::insertPackage(...) to insert those files into your repository.
Commit the changes, and push them to Github.
In the package that needs to use this non-CRAN package, add
Additional_repositories: https://yourname.github.io/drat
to the DESCRIPTION.
You will be responsible for updating your repository if BOLTSSIRR is updated. This is good because the updates might break yours: after all, it's still in development mode. It's also bad because your users won't automatically get bug fixes.
That's it, if I haven't missed anything!

Do packages installed from Github need Rtools?

I am creating my first package, which shall be installed through Github. I thought that Rtools was needed only for the person creating it. However, people that tried to install it using Github were asked to update Rtools. Is this really necessary?
Doing some research, I found this: https://community.rstudio.com/t/missing-rtools-should-i-be-worried/27817
One of the answers says the following:
"This means that if you are going to install packages that need
compilation, you also have to install Rtools in your system. "
This is the repo with the package: https://github.com/datazoompuc/PNAD_Covid/tree/master/R/datazoom_pnad_covid
What does this actually mean? How do I know that my package needs compilation?
I thought that Rtools was needed only for the person creating it.
Yes, if and only if you distribute it as a binary. Then the creator uses Rtools to compile and link, and the user just installs, and enjoys.
That is how CRAN works as CRAN compiles for Windows users.
GitHub, however, is foremost a source repository so the installation from GitHub is using a source mode ... and every user will need to compile, and hence have Rtools. (Unless the package and all its depedencies are R-code only.)
You can also have a package repository on GitHub using e.g. the drat package to create it, but that is getting us a little further from the original question.
Your package "needs compilation" — i.e. needs Rtools to install from source (on Windows) — if it contains C or Fortran components, i.e. if you have anything in the src/ directory of your package ...
If you, the package author, don't know if you have C or Fortran code as part of your package, then you almost certainly don't.
It's quite possible that devtools is being overzealous, i.e. detecting that users have a not-most-current Rtools and suggesting (requiring??) that they update it, even though it's not needed for this installation.

R package listed on CRAN but not in available package

I want to install a package that is listed in https://cran.r-project.org/web/packages/available_packages_by_name.html as available in CRAN, but when I check in R the install packages menu or the available.packages() command, I can't see the package there.
Do I need to do something different to install those packages? Why aren't those packages available?
The packages I'm interested on are WikipediR ( https://cran.r-project.org/web/packages/WikipediR/index.html ), WikidataR and WikipediaR.
If it matters, I'm using R 2.15.0 in Windows XP.
See the documentation for ?available.packages...
By default, the return value includes only packages whose version and
OS requirements are met by the running version of R, and only gives
information on the latest versions of packages.
In other words... your R 2.15 is likely too old for the package you are looking to download.
You can try to download the package source manually add the package to the package library usually found somewhere like "win-library/2.15/" but like Cory mentioned it is likely that the older version of R does not support the package build.
The advice given so far is a bit incomplete although I do agree you need to update your R version if you want to use these packages. Looks like they don't need compilation so you might have been able to either install from a local copy or drop R code in, but critically they depend on httr which requires R 3.0.0 or above. They were released only relatively recently, so there will be no Windows binaries from back in 2012. (Your copy of R is from 30-Mar-2012.) Look in the DESCRIPTION file which is presented in a nice web format at the CRAN/package listing:
https://cran.r-project.org/web/packages/WikidataR/index.html
Imports: httr, jsonlite, WikipediR
Suggests: testthat, knitr, pageviews
# only one version of these two
https://cran.r-project.org/src/contrib/Archive/WikidataR/WikidataR_1.0.0.tar.gz
https://cran.r-project.org/src/contrib/Archive/WikipediaR/WikipediaR_1.0.tar.gz
# pick one of these
https://cran.r-project.org/src/contrib/Archive/WikipediR/

R: can rpm files be used with Windows for possibly outdated R packages?

I was trying to run code that required the R packages ‘pkgDepTools’ and ‘Rgraphviz’. I received error messages saying that neither package is available for R version 2.15.0.
A Google search turned up the following webpage RPM Pbone that seems to have the packages:
http://rpm.pbone.net/index.php3/stat/4/idpl/17802118/dir/mandrake_other/com/R-pkgDepTools-1.20.0-1-mdv2012.0.i586.rpm.html
and
http://rpm.pbone.net/index.php3/stat/4/idpl/17802080/dir/mandrake_other/com/R-Rgraphviz-1.32.0-2-mdv2012.0.i586.rpm.html
However, the files have an *.rpm extension rather than the *.tar.gz or *.zip extensions I am used to.
I am using Windows 7 and R version 2.15.0. Can I install an R package from an *.rpm file?
From Wikipedia *.rpm seems like maybe it is more for Linux:
http://en.wikipedia.org/wiki/RPM_Package_Manager
Regarding other possible solutions, I have found several earlier posts here with similar questions about installing R packages that are not available for the most recent version of R:
Bivariate Poisson Regression in R?
Package ‘GeneR’ is not available
R Venn Diagram package Venerable unavailable - alternative package?
I have installed the latest version of Rtools and the package 'devtools'. Although I know nothing about them.
There is an archived version of 'Rgraphviz' here:
http://cran.r-project.org/src/contrib/Archive/Rgraphviz/
but I cannot locate an archived version of 'pkgDepTools'.
If I can install the packages on a Windows machine using the above *.rpm files could someone please provide instructions?
If I must use Rtools to build them I might ask more questions because the instructions at the link below are challenging for me:
http://cran.r-project.org/doc/manuals/R-admin.html#Building-from-source
To be completely transparent I am hoping someone might build them for me, if that is possible. Although I recognize the experience and knowledge gained from doing it myself would probably pay off in the long run.
Thank you for any advice.
pkgDepTools and Rgraphviz are BioConductor R packages not ones hosted on CRAN. Unless you configure your R to download packages from those repos, R will report that they are not available; it can only install from repos it has been configured to install from.
To install those BioConductor packages a lite installation method is provided:
source("http://bioconductor.org/biocLite.R")
biocLite(c("pkgDepTools", "Rgraphviz"))
Further details are provided on the Install page of the BioConductor website
In general you can't use rpm packages on Windows; rpm's are the equivalent of a binary package for Linux. Any C/C++/Fortran/etc code will have been compiled for Linux not Windows. If a package really isn't available for your version of R then check if there is a reason stated on CRAN (usually Windows binaries take a few days longer to produce or there may be requirements for software not available on the CRAN Windows build machines). You can try the WinBuilder service run by Uwe Ligges to build Windows Binaries of packages for you, but if the package was on CRAN and now isn't that suggests it no longer works with current R and can not be built.
In general try a wider search for packages; the first hit in my Google search results under the search string "pkgDepTools" is the Bioconductor page for the package which includes a link to the Windows binary and instructions on how to install the package from within R.
I think this merits an answer rather than a comment.
A gentleman at Bioconductor helped me get Rgraphviz installed. The primary problem was that the version of Rgraphviz I had downloaded only seems to work with the 32-bit version of R and I was running a 64-bit version of R. I was able to install Rgraphviz in the 32-bit version of R.
I had also made an error or two in the PATH statement during some of my attempts to install Rgraphviz. However, the post above in my second comment provides the instructions for installation.
You just, it seems, cannot install the normal download version of Rgraphviz in the 64-bit version of R.
I think many of our emails back and forth are now posted on the Bioconductor forum.
I might edit this answer with more detailed instructions in the next 24-hours.

Installation Error When Installing Package from R Forge

I am trying to update zoo from R Forge.
install.packages("zoo", repo = "http://r-forge.r-project.org")
But I get the following error
Installing package(s) into ‘C:/REVOLU~1/R-COMM~1.3/R-212~1.2/library’
(as ‘lib’ is unspecified)
Warning in install.packages :
cannot open: HTTP status was '404 Not Found'
Warning in install.packages :
cannot open: HTTP status was '404 Not Found'
Warning in install.packages :
unable to access index for repository http://r-forge.r-project.org/bin/windows/contrib/2.12
Warning in install.packages :
package ‘zoo’ is not available
I am using Revolution R Community version 4.3 (64-bit).
install.packages("zoo")
Installs a slightly dated version of zoo
To clarify #DWin's and Gabor's answers slightly more:
You are running into trouble because R-forge only builds binaries for the current (2.14 right now) and development ("2.15", but Brian Ripley will probably get mad if you refer to it that way) versions of packages. In this situation you have the following options:
Upgrade R to the current version (the best idea).
If you have good reasons you can't do that (you don't have administrative rights, you are running a critical analysis that depends on a previous version of R, you need to use Revolution R because of its extensions etc.), then you can try one of the following:
(as suggested by #jthetzel's comment above) follow the links to the binary version of the package, download the binary file (zip in the case of Windows), and try installing from the local copy (with repos=NULL, or from the appropriate menu entry). This will not work if the package depends, implicitly or explicitly, on features in the latest version of R.
try to install the source version of the package: install.packages("thispkg",repos="http://r-forge.r-project.org",type="source"). This will only work if (1) you have the tools for compiling packages from source installed (see the R manual, or (for Windows) the R for Windows FAQ, google for "Rtools", etc., or (for MacOS) the R for MacOS FAQ) or (2) the package contains only R code, not compiled C/FORTRAN code (not true in the case of the zoo package, I think).
download the source package, unpack it, modify the DESCRIPTION file so that the maintainer e-mail is your own, rebuild the source package, and upload it to the CRAN win-builder service. (If you don't modify the DESCRIPTION file then you won't be informed that the package has been built and where to download it -- you'll just annoy and confuse the maintainer of the package, who will receive the e-mail.) (This only works for Windows.)
Some of the resistance you've been getting is directed less at you than at Revolution R. There's nothing wrong (I don't think) with their making money from R, but when providing support for Revolution R adds to the workload of the R community (ordinarily we would just say "upgrade to the latest version of R" and be done with it), people get a little grumpy.
This is the weekend, .... a typical time for site maintenance. A 404 message could be telling you to either wait a few hours or use a different mirror. In this case using a browser shows that the link really does not exist but its stem does and has code only for R versions 2.14 and 2.15.
You have not given enough information to determine why "version 4.3" is not accessing a current version of "zoo" but it would seem more appropriate to contact the Revolution R people or a support group dedicated to that version than post a message on a volunteer website where they seem to have no regular representative. I'm guessing that your "version 4.3" is based on R 2.12.x and that you would get failure if you actually did find a current version. You should be providing sessionInfo() rahter than the RevoR version number. The RevoR product has a Support Forum at http://forums.revolutionanalytics.com/ . My effort to determine what version they are currently shipping are frustrated by their insistence on having every query go through their personal information gathering protocol. I was unable to find online technical specs for their currently available version of "Community version".
EDIT: It appears you have already been discussing this with Gabor. He is an undisputed authority on the behavior of "zoo". You should not be looking elsewhere for advice.

Resources