Difference between revisions of "R console (tutorial)"

From visone manual
Jump to navigation Jump to search
(Sending networks from visone to R)
(Sending networks from visone to R)
Line 5: Line 5:
 
==Sending networks from visone to R==
 
==Sending networks from visone to R==
  
To send the network from visone to R go to the [[R_console_tab]], assign a name to the network in the textfield '''r name''' (you might just accept visone's suggestion for this name, which should be ''egonet''), and click on the '''send''' button.
+
To send the network from visone to R open the [[R console tab]], choose a name in the textfield '''r name''' (you might just accept visone's suggestion for this name, which should be ''egonet''), and click on the '''send''' button.
  
After clicking on '''send''' visone starts the Rserve connection and opens the R-console. If this does not work you should check the settings of [[Option_dialog#R_-_connection|R connection options]] accessible from the '''file''' menu. If it works and you type
+
After clicking on '''send''' visone starts the Rserve connection and opens the R-console. If this does not work you should check the settings of [[Option_dialog#R_-_connection|R connection options]] accessible from the '''file''' menu. If it works you should get a message like
   ls()
+
   ready to serve
in the input field at the bottom of the R console and press enter, you list all variables that are in the R workspace - currently there is one variable called ''egonet''.
+
  visone: sendActiveNet egonet
 +
  done
 +
  visone: lsIGraph
 +
  "egonet"
 +
in the message field of the R console.
  
 
[[File:R_console_ls.png]]
 
[[File:R_console_ls.png]]
  
As we'll see soon, ''egonet'' is an object of class ''igraph'' which is an R package obtainable from a [http://cran.r-project.org/ CRAN Website] and documented in more detail on [http://igraph.sourceforge.net/ http://igraph.sourceforge.net/].
+
You can list all variables that are in the R workspace by typing
 +
  id()
 +
in the input field at the bottom of the R console (currently there is one object called ''egonet'').
 +
As we'll see soon, ''egonet'' is an object of class ''igraph'' which is an R package obtainable from a [http://cran.r-project.org/ CRAN Website] which also gives you access to R tutorials and documentation. The igraph package is documented in more detail on [http://igraph.sourceforge.net/ http://igraph.sourceforge.net/].
  
 
==Basic statistics about an igraph object==
 
==Basic statistics about an igraph object==

Revision as of 14:02, 11 February 2011

This trail illustrates how to send network data from visone to R and back. The R project for statistical computing offers a rich set of methods for data analysis and modeling which become accessible from visone through the R-console. We assume that you have installed the R connection as it is explained in the installation trail.

To follow the steps illustrated in this trail you should download the network file Egonet.graphml which is linked from and explained in the page Egoredes_(data). Further you should remove all ties that are not rated as very likely in the same manner as it is explained in the last section of the visualization and analysis trail.

Sending networks from visone to R

To send the network from visone to R open the R console tab, choose a name in the textfield r name (you might just accept visone's suggestion for this name, which should be egonet), and click on the send button.

After clicking on send visone starts the Rserve connection and opens the R-console. If this does not work you should check the settings of R connection options accessible from the file menu. If it works you should get a message like

 ready to serve
 visone: sendActiveNet egonet
 done
 visone: lsIGraph
 "egonet" 

in the message field of the R console.

R console ls.png

You can list all variables that are in the R workspace by typing

 id()

in the input field at the bottom of the R console (currently there is one object called egonet). As we'll see soon, egonet is an object of class igraph which is an R package obtainable from a CRAN Website which also gives you access to R tutorials and documentation. The igraph package is documented in more detail on http://igraph.sourceforge.net/.

Basic statistics about an igraph object