Installing

tnet » Software » Installing

tnet is an extension package to R that can be downloaded using the CRAN-servers. There are three steps to get tnet up and running:

1: Installing R

R is an open-source package that can be compiled on the vast majority of platforms. There are also pre-compiled versions for Windows (both Win32 and x64), Mac OS X (release 10.5 and above), and Debian, Redhat, Suse, and Ubuntu Linux. To get the source code or the pre-compiled versions, you need to go to www.r-project.org, click on CRAN under Download on the right, select a server close to you, select your operating system (e.g., Windows), click on base, and then click on Download R on the top of the page. Then you need to follow the installation instructions on your screen.

If you are using Windows on a fairly new computer, you might have a 64-bit version of Windows installed instead of the ‘old’ 32-bit version. You can find out which version you have by right-clicking on Computer/My Computer on the Start menu, and selecting Properties. If you have the 64-bit version of Windows installed, I would recommend that you install the 64-bit version of R as more memory will then be available.

For more information, see the R-website.

2: Installing tnet

The standard command for installing packages in R is install.packages(). To install tnet using this command, you would simply type install.packages("tnet") and then select a server close to you.

If you are using the Windows version of R, you should be able to install tnet by going to the ‘Package’-menu, opening ‘Install package(s)’, selecting a server close to you, and then, choosing ‘tnet’ from the list.

Updating tnet

tnet is in constant development. If you have installed extension packages, I would recomment that you run update.packages() once in a while to get the lastest version of the installed packages. This command will update any of the extension packages that you might have on your system if a new version is available, including tnet.

3: Loading tnet

The functions within an installed package is not available unless the package is specifically loaded. Everytime a new session (i.e., a window) is opened, the required packages for that session need to be loaded. This is done using a function called library. As shown in the code examples, tnet is loaded by typing library(tnet) in R.

If you use tnet, please cite: Opsahl, T., 2009. Structure and Evolution of Weighted Networks. University of London (Queen Mary College), London, UK, pp. 104-122. Available at https://toreopsahl.com/publications/thesis/.

12 Comments Add your own

  • 1. Alireza  |  November 15, 2011 at 10:23 pm

    Hi
    it seems R version 2.14.0 doesn’t support tnet, right?
    I was trying to install tnet and got this warning message
    “In getDependencies(pkgs, dependencies, available, lib) : package ‘tnet’ is not available (for R version 2.14.0)”

    Look forward to hear from you
    Thanks so much

    Reply
    • 2. Alireza  |  November 16, 2011 at 12:04 am

      Sorry, it works.
      The problem was that I should have set proxy in R (using setInternet2(TRUE) ).

      Reply
      • 3. Tore Opsahl  |  November 16, 2011 at 12:39 am

        Alireza,

        Great that you got it to work!

        Hope you’ll find it useful.

        Tore

  • 4. Fabian  |  January 21, 2013 at 3:37 pm

    Hello,
    thank you very much for this blog. I have the same problem of Alireza, but I don’t know how it fixed.
    “In getDependencies(pkgs, dependencies, available, lib) : package ‘tnet’ is not available”

    Best regards

    Reply
    • 5. Tore Opsahl  |  January 21, 2013 at 8:36 pm

      Hi Fabian,

      Please try to download the package, and the dependencies, manually and install using those files. This is probably an issue with the connection to the CRAN servers.

      Best,
      Tore

      Reply
  • 6. Fabian  |  January 22, 2013 at 9:59 am

    Thank you for your quick response, but from where can I download manually the tnet package? Apparently it isn’t on the CRAN servers.

    Best regards, and thank you very much
    Fabián

    Reply
  • 9. junyan  |  May 19, 2015 at 8:58 pm

    how do I install and load tnet onto unix?

    Reply
    • 10. Tore Opsahl  |  May 24, 2015 at 1:56 pm

      Hi Junyan,

      First you need R. Then you can simply type install.packages(“tnet”) in R.

      Tore

      Reply
  • 11. Yimmy  |  January 13, 2016 at 1:08 pm

    Hi Tore, I haved installed package from local zip files(including igraph and survival).However,after I typed ” library(tnet) “,it said as follows:

    Loading required package: igraph
    Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
    there is no package called ‘magrittr’
    Error: package ‘igraph’ could not be loaded

    Looking forwarding to your help.Thanks! Yimmy

    Reply
    • 12. Tore Opsahl  |  January 19, 2016 at 4:51 am

      Hi Yimmy,

      That is an igraph issue. Please reach out to them directly.

      Best,
      Tore

      Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Subscribe to the comments via RSS Feed


%d bloggers like this: