Imperial College/Courses/Fall2008/Synthetic Biology (MRes class)/'R' Tutorial/Basic Commands

From OpenWetWare
Jump to navigationJump to search
Fall 2008 - Synthetic Biology (MRes class)


Home        'R' Tutorial        Resources        Literature

<html> <body> <!-- Start of StatCounter Code --> <script type="text/javascript"> var sc_project=3315864; var sc_invisible=0; var sc_partition=36; var sc_security="8bb2efcd"; </script>

<script type="text/javascript" src=""></script><noscript><div class="statcounter"><a class="statcounter" href=""><img class="statcounter" src="" alt="blog stats" /></a></div></noscript> <!-- End of StatCounter Code -->

</body> </html>

Introduction to 'R'

Running 'R' programs

  • From windowing system
    • From a file
      • source("my_program.txt")
  • From command line
    • R

Getting help with functions and features

  • 'R' has an inbuilt help facility. If the function/feature name is toto, you can find help by typing either:
    • help(toto)
    • ?toto
  • Remember, 'R' is case sensitive.

Data types

  • Vectors
  • Lists
  • Factors
  • Matrices
  • Data Frames

Basic inputs/outputs

  • read.table(filename, HEADER=TRUE)
  • read.cvs(filename)

Basic plotting

  • plot()
  • hist()
  • boxplot()
  • par()
  • mtext()
  • title()
  • curve()
  • abline()

Writing your own functions

Regression analysis

  • lm()

ODE solver

  • lsoda()