Wednesday, June 1, 2011

"Alpha" version of phytools package now available

I just wanted to let you know that I have just posted the first "alpha" version of my "phytools" (phylogenetic tools for comparative biology - and other things) package online at my R phylogenetics page (direct link to zipped tarball here).

To install, simply download the file, navigate to the appropriate directory, and then type:

> install.packages("phytools_0.0-1.tar.gz",type="source")

The package can then be loaded as normal, i.e.,

> require(phytools)

or

> library(phytools)

in the current or future R sessions.

Please let me know if you find any difficulties with functions loaded this way, rather than downloaded and loaded from their individual source files. (Or, of course, any difficulties in general.) I look forward to comments! (Even a report of successful installation is more than welcome.)

Unfortunately, I have not yet written man pages for these functions, so this will have to come in the first "beta" version release of "phytools" - hopefully some time soon.

13 comments:

  1. In the first version of this post I claimed:
    "I believe one could also load the source directly from the hosting URL, i.e.:
    > install.packages("http://anolis.oeb.harvard.edu/~liam/R-phylogenetics/phytools_0.0-1.tar.gz",type="source")"
    Unfortunately, I didn't seem to be able to get that to work, so I have removed the suggestion.

    ReplyDelete
  2. Unfortunately,
    install.packages("phytools_0.0-1.tar.gz",type="source")

    didn't work for me after downloading your tarball. Does it work on your machine?

    ReplyDelete
  3. Hi Scott. Yes, it does work on my machine with no problem. I am in Windows (although this should not matter, I don't think, but this is difficult for me to test). Please let me know if you can figure it out; or if other users have better luck, please speak up. Also, feel free to post the error message that is returned by R when you try to execute this. Thanks for the comment by the way! - Liam

    ReplyDelete
  4. > install.packages("phytools_0.0-1.tar.gz",type="source")
    Installing package(s) into ‘/Library/Frameworks/R.framework/Versions/2.13/Resources/library’
    (as ‘lib’ is unspecified)
    inferring 'repos = NULL' from the file name
    Warning in file(name, "wb") :
    cannot open file 'phytools_0.0-1/DESCRIPTION': Permission denied
    Error in file(name, "wb") : cannot open the connection
    Warning in install.packages :
    installation of package 'phytools_0.0-1.tar.gz' had non-zero exit status



    > sessionInfo()
    R version 2.13.0 (2011-04-13)
    Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)

    locale:
    [1] C/en_US.UTF-8/C/C/C/C

    attached base packages:
    [1] stats graphics grDevices utils datasets methods base

    other attached packages:
    [1] infochimps_0.3 RJSONIO_0.7-1 stringr_0.4 RCurl_1.5-0 bitops_1.0-4.1

    loaded via a namespace (and not attached):
    [1] plyr_1.5.1 tools_2.13.0

    ReplyDelete
  5. Up and running on a PC!! (Windows 7)

    My Mac is at work, so I can't try that till tomorrow, but I've run a couple functions without problems on the PC.

    Congrats on getting this up!

    ReplyDelete
  6. I got somewhat the same error:

    > sessionInfo()
    R version 2.13.0 (2011-04-13)
    Platform: i386-apple-darwin9.8.0/i386 (32-bit)

    locale:
    [1] en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8

    attached base packages:
    [1] stats graphics grDevices utils datasets methods base

    loaded via a namespace (and not attached):
    [1] tools_2.13.0

    > install.packages('/Users/RMaia/Downloads/phytools_0.0-1.tar.gz',type='source')
    inferring 'repos = NULL' from the file name
    Warning in file(name, "wb") :
    cannot open file 'phytools_0.0-1/DESCRIPTION': Permission denied
    Error in file(name, "wb") : cannot open the connection
    Warning message:
    In install.packages("/Users/RMaia/Downloads/phytools_0.0-1.tar.gz", :
    installation of package '/Users/RMaia/Downloads/phytools_0.0-1.tar.gz' had non-zero exit

    #and if I try using the Package Installer:

    Warning in file(name, "wb") :
    cannot open file 'phytools_0.0-1/DESCRIPTION': Permission denied
    Error in file(name, "wb") : cannot open the connection


    BUT... then I tried uncompressing the file, and I started getting more specific errors:

    > install.packages("/Users/RMaia/Desktop/phytools_0.0-1",repos=NULL,type="source")
    WARNING: omitting pointless dependence on 'R' without a version requirement
    * installing *source* package ‘phytools’ ...
    ** R
    ** preparing package for lazy loading
    Loading required package: quadprog
    Warning message:
    In install.packages("/Users/RMaia/Desktop/phytools_0.0-1", repos = NULL, :
    installation of package '/Users/RMaia/Desktop/phytools_0.0-1' had non-zero exit status
    Loading required package: igraph
    Warning in library(pkg, character.only = TRUE, logical.return = TRUE, lib.loc = lib.loc) :
    there is no package called 'igraph'
    Error : package 'igraph' could not be loaded
    ERROR: lazy loading failed for package ‘phytools’
    * removing ‘/Library/Frameworks/R.framework/Versions/2.13/Resources/library/phytools’


    Then I installed and loaded the quadrprog package, and tried again. The installation went a bit further, but stopped when trying to load the igraph package. After installing and loading it, seems the installation was successful!

    > install.packages("/Users/RMaia/Desktop/phytools_0.0-1",repos=NULL,type="source")
    WARNING: omitting pointless dependence on 'R' without a version requirement
    * installing *source* package ‘phytools’ ...
    ** R
    ** preparing package for lazy loading
    Loading required package: quadprog
    Loading required package: igraph
    Loading required package: rgl
    ** help
    No man pages found in package ‘phytools’
    *** installing help indices
    ** building package indices ...
    ** testing if installed package can be loaded

    * DONE (phytools)

    > library(phytools)
    Loading required package: ape
    Loading required package: phangorn
    Loading required package: igraph
    Loading required package: rgl

    > help(package="phytools") #works fine
    > branching.diffusion(time.stop=10) #quick test of a function, works fine as well!


    Hope that helps! Thanks for putting this together!

    ReplyDelete
  7. Thanks for the feedback guys. Not sure what the problem is exactly, but it seems to be Mac/Linux vs. PC specific. I will try to sort this out ASAP. - Liam

    ReplyDelete
  8. BTW, this is what I get when I install to my netbook:

    > install.packages("phytools_0.0-1.tar.gz", type="source")
    inferring 'repos = NULL' from the file name
    WARNING: omitting pointless dependence on 'R' without a version requirement
    * installing *source* package 'phytools' ...
    ** R
    ** preparing package for lazy loading
    Loading required package: quadprog
    Loading required package: igraph
    Loading required package: rgl
    ** help
    No man pages found in package 'phytools'
    *** installing help indices
    ** building package indices ...
    ** testing if installed package can be loaded

    * DONE (phytools)
    > sessionInfo()
    R version 2.11.1 (2010-05-31)
    i386-pc-mingw32

    locale:
    [1] LC_COLLATE=English_United States.1252
    [2] LC_CTYPE=English_United States.1252
    [3] LC_MONETARY=English_United States.1252
    [4] LC_NUMERIC=C
    [5] LC_TIME=English_United States.1252

    attached base packages:
    [1] stats graphics grDevices utils datasets methods base

    ReplyDelete
  9. just a quick follow-up, I tried reinstalling it while having the required quadprog, igraph and rgl packages loaded to see if that was the issue, but the installation still failed.

    However, uncompressing the tar.gz file and using the folder as a source still worked even if those three packages weren't loaded (as long as they were installed, it would call and load them).

    Don't know exactly if that'd help solve the problem, but maybe it'll at least help mac users install the package, if anyone can replicate this behavior. Cheers!

    ReplyDelete
  10. Thanks for posting this Liam. This is great.

    I am on a Mac and had similar problems as people mentioned above. I got the package to install by doing the following:

    1) unarchiving the tar.gz folder

    2) in the terminal, I moved to the folder where the phytools was and typed the command
    R CMD INSTALL phytools_0.0-1

    3) Then in the R-terminal, I just typed library(phytools)

    cheers,
    matt

    ReplyDelete
  11. Thanks for the fix. Seems to be a Mac/Linux vs. PC issue. I will have to try and figure this one out!

    ReplyDelete

Note: due to the very large amount of spam, all comments are now automatically submitted for moderation.