background preloader

R Programming

Facebook Twitter

R Tutorial. Home > Teaching > Tutorials > R Tutorial Index 3 ::: Plotting in R R is a powerful (and free) statistical software that is making headway into academic, government, and industry uses. It may be downloaded on r-project.org at no cost. plot()labeling the title and axesplotting windowsplotting optionshist() and histogram()boxplot()stripchart() (dot plot) plot() The most common plotting function is plot(). This function can take several types of objects. > x <- 1:20 > y <- 3*x + 5 # creating a line with slope 3 and y-intercept 5 > plot(x, y) It plots the second variable (in this case, y) against the first variable (in this case, x).

If there is a frequency table from two variables, plot can also read in the table and make a mosaic plot of the data. > tab1 <- table(Year, Gender) > plot(tab1) The function plot is very versatile and this is by no means a thorough overview of its capabilities. top labeling the title and axes The title is called main in R. Plotting windows par(mfrow=c(2,3)) plotting options. Home Page. Producing Simple Graphs with R.

Pie Charts. Data Mining Algorithms videos. The R Program. Social network analysis. R for Social Network Analysis R is an open-source statistical programming platform and a useful tool for sna with many advantages over traditional sna software packages. With a little coding and patience, one can produce analyses and visualizations that better suit the problem at hand with this singular platform, rather than learning gui application after application.

To begin using R for sna, install R and the following packages: igraph, sna, network, statnet. The links to the right provide a good introduction to the capabilities of each package, and the built-in R documentation for each package provides the detail for each function. Much of the material here is convered in the more comprehensive "Social Network Analysis Labs in R and SoNIA," on which I collaborated with Dan McFarland, Sean Westwood and Mike Nowak. This material is designed to be friendly to users with no experience with social network analysis (sna), but it is not a thorough introduction.

Social Networks Works cited: Network Analysis with igraph.