Package Intergraph

R world provides several packages for working with network data. This package supplements that functionality by providing methods for converting network data objects between classes defined in other packages.

Currently supported classes/packages: network, and igraph.

See this post on my blog and all the other posts tagged with a tag 'intergraph'.

Important! On October 18, 2010 Carter Butts released version 1.5-1 of package network. The new version has R namespace implemented. Consequently, package intergraph will work with this new version out of the box. You do not have to install my “hacked” version as described below.

Consequently,

install.packages("intergraph", repos="http://bojan.3e.pl/R")

should suffice to install intergraph to the default R library tree.

Installation instructions

Package intergraph depends on package network. To be able to work reliably with the network package it has to have a namespace. At this moment (September, 2010) the network package does not have a namespace so I had to create a version that does have one. Until the official network package will have a namespace to use the intergraph package you have to download and install my modified version of network. See below for one way how to do that.

Namespaced version of ''network''

To install namespaced version of the network package (tagged with version 1.4-1-1):

From sources

On Linux-alikes you can install it directly from R by using the function install.packages. Using default settings of install.packages will install the namespaced network package to the default R library tree. The default library R tree is the directory in the first element returned by .libPaths(). Most likely you have already an “official” version of the network package installed there so it will get overwritten. If you are OK with that proceed as in item (1) below.

  1. Installing to default library tree
    1. Call
      install.packages("network", contriburl="http://bojan.3e.pl/R/hacks")
  2. Installing to a separate library tree (recommended)
    1. Create a new directory somewhere, for example ~/lib/R. This may be any directory you have a permission to write to. For the remaining items below we will assume it is ~/lib/R. If you choose something else substitute it in the calls below.
    2. Install the package there by calling install.packages with an extra argument lib set to this new directory. Taking the one for the preceding item the call would look like this:
      install.packages("network", lib="~/lib/R", contriburl="http://bojan.3e.pl/R/hacks")
    3. After the package is installed there are several ways to load that package while in the R session:
      1. Use library function with an additional lib argument, much like with install.packages above:
        library(network, lib="~/lib/R")
      2. Let R know of the extra library tree we just created by registering it with a call to .libPaths and then use the library function as usual. Please mind however, that the namespaced version package will have “priority” over any other version of the network package you might have installed to the other directories. With this approach you will:
        .libPaths("~/lib/R") # register the extra library tree
        library(network) # load the package

On Windows

At this moment I provide Windows binary versions only for R versions 2.9, 2.10, and 2.11.

To install the Windows binary version of the package you can use install.packages function from within R. By default it will install the package to default library tree. R's default library tree is the directory on the first position in the vector returned by calling .libPaths().

Most likely you have already installed an official version of the network package there. In such case using install.packages with default settings would overwrite the already installed version. If you are OK with that proceed as in the item 1. below. If not, you can install the package into a separate library tree as explained in the item 2.

  1. To install a Windows binary version to the default library tree use one of:
    install.packages("network", contriburl="http://bojan.3e.pl/R/hacks/2.9")
    install.packages("network", contriburl="http://bojan.3e.pl/R/hacks/2.10")
    install.packages("network", contriburl="http://bojan.3e.pl/R/hacks/2.11")

    depending on your R version.

  2. To install into a separate library tree (recommended)
    1. Create a new directory somewhere, for example c:\R\mylibrary. This may be any directory you have a permission to write to. For the remaining items below we will assume it is c:\R\mylibrary. If you choose something else substitute it in the calls below.
    2. Run one of the above commands with an additional argument lib set to the path to that new directory. The package will be installed there. So, for example, to install the package for R version 2.11 you would use (mind the use of forward slashes):
      install.packages("network", lib="c:/R/mylibrary",
          contriburl="http://bojan.3e.pl/R/hacks/2.11")
    3. After the package is installed you can load it with one of:
      1. Use library function with an additional lib argument, much like with install.packages above:
        library(network, lib="c:/R/mylibrary")
      2. Let R know of the extra library tree we just created by registering it with a call to .libPaths and then use the library function as usual. Please mind however, that the namespaced version package will have “priority” over any other version of the network package you might have installed to the other directories. With this approach you will:
        .libPaths("c:/R/mylibrary") # register the extra library tree
        library(network) # load the package

Installing ''intergraph''

To install the intergraph package to the default library tree on both Windows or Linux-alikes use

install.packages("intergraph", repos="http://bojan.3e.pl/R")
 
public/r/packages/intergraph.txt · Last modified: 2010/12/20 20:42 by michal
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki