Thursday, August 18, 2011

Installing "phytools"

I can see that at least a few visitors to the "phytools" blog have reached this page through the google search "installing phytools" - so I thought I'd say a couple of words about how this can be done at present.

1) Download the package from my R phylogenetics page. If you are a Windows user, you can download the Windows binary (this file ends in ".zip"). If you are a Mac or Linux/Unix user, download the package source (this file ends in ".tar.gz" - actually, you should also be able to install from source in Windows if you are so inclined).

2) Either navigate to the directory containing the "phytools" package installation file, or move the file to your current directory. For the former, you can either use the Windows GUI File->Change dir...; or the R command setwd(). For the latter, the R command getwd() (which returns your current working directory) should be helpful.

3) Now simply enter either:

install.packages("phytools_0.0-7.zip",repos=NULL)

(for Windows installation, assuming the latest version of "phytools"), or:

install.packages("phytools_0.0-7.tar.gz",repos=NULL,type="source")

for installation from source.

4) Finally, to load the "phytools" library, one simply types (as with any other contributed package):

library(phytools)

and you're ready to go!

**Note that I am getting ready to submit "phytools" to CRAN which will have the effect of collapsing steps 1-3 into a single command.**

2 comments:

  1. The information in this post is very out of date. I would only recommend installing phytools from CRAN or from GitHub using devtools.

    ReplyDelete
    Replies
    1. Hi Liam,
      Thank you very much for your recommendation. I have been using your several packages a lot for my phylogenetic analysis. I really appreciate it.
      That being said, I am still having some issue installing this package in my remote server with linux-gun system. I have no problem installing this on my local machine tho. I have tried many different ways, like install.packages("phytools") from CRAN or install_github("liamrevell/phytools") from Github, or even download the source package and try to install from there using the method you recommended in this article. The error I am getting is either something like "installation of package 'phytools' had non-zero exit status" or "installation of package 'magick' had non-zero exit status" and "installation of package 'animation' had non-zero exit status".
      I kind feel it it my server's configuration program, but I am not so sure, and I am not able to modify the server configuration because I dont have a sudo role.
      I really appreciate your time.
      Best regards,
      Yong

      Delete

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