Example: stock market

R Programming - University of Oxford

R ProgrammingRobin 2014 This version: November 5, 2014 AdministrationThe course webpage is ~ are at 10am on Mondays and Wednesdays, and practicals at 9amon Tuesdays and Thursdays; in reality, there will be rather a lot of overlapbetween these two bring your own laptop to use during all classes, and ensure that youhaveRworking (see below). If you don t have access to a laptop, let meknow and we will try to provide will hold office hours each week during Michaelmas term onWednesdaysbetween 12pm and 1pm; my office is on the first floor of 2 SPR, room204.

you’ve mastered these few di culties, the only barrier to uency is the vast vocabulary of R: even in the basic packages there are many commands which you will never use or understand, but the more you learn the more elegantly you will be able to …

Tags:

  Programming, R programming, Culties

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Advertisement

Transcription of R Programming - University of Oxford

1 R ProgrammingRobin 2014 This version: November 5, 2014 AdministrationThe course webpage is ~ are at 10am on Mondays and Wednesdays, and practicals at 9amon Tuesdays and Thursdays; in reality, there will be rather a lot of overlapbetween these two bring your own laptop to use during all classes, and ensure that youhaveRworking (see below). If you don t have access to a laptop, let meknow and we will try to provide will hold office hours each week during Michaelmas term onWednesdaysbetween 12pm and 1pm; my office is on the first floor of 2 SPR, room204.

2 I m very happy to help with any difficulties or problems you are havingwithR, butplease take steps to help yourselves first(see below for alist of resources).SoftwareYou should installRon your own computer at the first opportunity. details. Ensure you have the latest version (as of the start of Michaelmas2014, this was version ). Try to spend some time getting used to thebasics of the software, including arithmetic operations and functions. Thereare many excellent online tutorials for this strength ofRis itshelp files, which we will discuss. These are accessedwith the?

3 And?? almost all the answers, and knows much more aboutRthan I do. If you have a problem, it s extremely likely that someone willhave had the same difficulty already, and posted a question on an useful, though not required. Here are a some of them with , and Ripley, (2002)Modern Applied Statistics 4th classic (2010) - Software for Data Analysis: Programming with R, of few books with information on more advanced Programming (S4,overloading). , H. (2014) Advanced R. Chapman and great new book on the more advanced features: a good follow up to , M.

4 (2007) The R Book. , J. (2002) A R and S-PLUS Companion to Applied Regression. what it , U. (2009) Programmieren mit R. Third edition. German(!) , M. L. (2008) Statistical Computing with R. CRC/Chapman & computational different examples to the other , W. J. and Murdoch, D. J. (2007) A First Course in StatisticalProgramming with R. and well written, but at a rather low level. A bit redundant giventhe J. and Braun, W. J. (2003) Data Analysis and Graphicsusing R Second or third edition statistical , P. (2008) Data Manipulation with R.

5 SpringerEspecially for data , P. (2009) Introductory Statistics with R. Second Edition. redundant given the the Most out of the ClassLearningRhas much in common with learning a natural language: it s easyto get going with a few simple phrases, though you ll find some idiosyn-crasies in the syntax, and occasional aspects are downright illogical. Onceyou ve mastered these few difficulties, the only barrier to fluency is the vastvocabulary ofR: even in the basic packages there are many commands whichyou will never use or understand, but the more you learn the more elegantlyyou will be able to express yourself.

6 There is a smaller core of everyday lan-guage which we will focus on, and which you will be expected to understandin exams and practical lecture notes are intended for reference, and will (by the end of thecourse) contain sections on all the major topics we cover. Lectures will notfollow the notes exactly, so be prepared to take your own notes; the practicalclasses will complement the lectures, and you can be examined on anythingwe study in t copy and pastethe commands from this guide intoR; you will findit very hard to remember the details of the language and will have to lookeverything up when you come to code something sure youtry the exercises, and understand the code involved ineach one.

7 If something doesn t make sense, useR s help functions, ask aclassmate, try using internet resources, or ask me for help (preferably inthat order). Some exercises are marked with an asterisk (*), which meansthey are a little more advanced than is necessary for the you find any mistakes or omissions in these notes, I d be very grateful tobe WhatRis good atStatistics for relatively advanced users:Rhas thousands of packages, de-signed, maintained, and widely used by graphics: try doing some of our plots in Stata and you won t havemuch code:Rhas a rather liberal syntax, and variables don t need to bedeclared as they would in (for example) C++, which makes it very easy tocode in.

8 This also has disadvantages in terms of how safe the code :Ris designed to make it very easy to write functions whichare applied pointwise to every element of a vector. This is extremely usefulin powerful: if a command doesn t exist already, you can code it WhatRis not so good atStatistics for non-statisticians: there is a steep learning curve, which putssome people Stata, SAS or SPSS (if you must).Numerical methods, such as solving partial differential equations;try methods, such as algebraically integrating a Math-ematica or graphics, such as might be useful in psychology Though it does have some very easy to use methods , high-speed or critical code;use C, C++, Java or similar.

9 (How-ever note that such code can be called fromRto give the best of bothworlds . General PropertiesRmakes it extremely easy to code complex mathematical or statistical proce-dures, though the programs may not run all that quickly. You can interfaceRwith other languages (C, C++, Fortran) to provide fast implementationsof subroutines, but writing this code (and making it portable) will typicallytake longer. Where the advantage falls in this trade-off will depend upon4what you re doing; for most things you will encounter during your degree,Ris sufficiently open source and widely adopted by statisticians, biostatisticians, andgeneticists.)

10 There is a huge wealth of existing libraries so you can oftensave time by using these, though it is sometimes easier to start from scratchthan to adapt someone else s function to meet your needs. Contributing newpackages to the central repository (CRAN) is easy: even your lecturer hasmanaged it. As a result,Rpackages are not build to very high standards(but see Bioconductor).Ris portable, and works equally well on Windows, OS X and InterfacesFor Windows and OS X, the standardRdownload comes with anRGUI,which is adequate for simple tasks. You can also runRfrom the commandline in any operating are a number of more powerful interfaces which you may like to s a popular, with a nice interface and well thought out, espe-cially for more advanced usage: can be a bit buggy, so make sure youupdate it regularly.


Related search queries