Imperial College/Courses/Fall2008/Synthetic Biology (MRes class)/'R' Tutorial/Basic Commands
From OpenWetWare
Jump to navigationJump to search
<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="http://www.statcounter.com/counter/counter_xhtml.js"></script><noscript><div class="statcounter"><a class="statcounter" href="http://www.statcounter.com/"><img class="statcounter" src="http://c37.statcounter.com/3315864/0/8bb2efcd/0/" 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 a file
- 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()