Stories
Slash Boxes
Comments

SoylentNews is people

posted by janrinok on Saturday August 27 2016, @10:43PM   Printer-friendly
from the something-to-do-this-weekend dept.

First of all, the question is 'Why Use R'. One source answers that question thus:

R is the leading tool for statistics, data analysis, and machine learning. It is more than a statistical package; it's a programming language, so you can create your own objects, functions, and packages.

Speaking of packages, there are over 2,000 cutting-edge, user-contributed packages available on CRAN (not to mention Bioconductor and Omegahat). Many packages are submitted by prominent members of their respective fields.

[More....]

For Beginners in R, here is a 15 page example based tutorial that covers the basics of R.

  1. Starting R – Trivial tutorial on how to start R for those just wondering what to do next after downloading R.
  2. Assignment Operator – Two important assignment operators in R are <- and =
  3. Listing Objects – All entities in R are called objects. They can be arrays, numbers, strings, functions. This tutorial will cover topics such as listing all objects, listing object from a specific environment and listing objects that satisfy a particular pattern.
  4. Sourcing R File – R code can also be written in a file and then the file can be called from the R code.
  5. Basic Datastructures in R – Understanding data structures is probably the most important part of learning R. This tutorial covers vector and list. It also covers subsetting.
  6. Data Structures in R, Matrix and Array – Covers matrix and vectors. An array is a vector with additional attributes dim which stores the dimension of the array and dimnames which stores the names of the dimensions. A matrix is an 2 dimensional array. Head to the tutorial for examples of both.
  7. Data Structures in R, factors and Data Frame – DataFrames are probably the most widely used data structure. It would help to just go through the examples and practice them. The tutorial covers important operations on the data frame and factors as well as subsetting data frames.
  8. Data Structures in R, Data Frame Operations – Covers some more operations on the data frame; including stack, attach, with, within, transform, subset, reshape and merge
  9. Control Structures in R – The basics of any programming language. Control loops allow looping through data structures. The tutorial covers if, if-else, for, while, next, break, repeat and switch
  10. Control Structures in R – apply – To make looping more efficient R has introduced a family of ‘apply’ functions. For example – the apply function can be used apply a function over specific elements of an array (or matrix). The tutorial covers lapply, sapply, apply, tapply.
  11. Control Structures in R – apply 2 – We continue with some more apply functions – mapply and by.
  12. Functions in R – The nuts and bolts of any programming language. This tutorial not only explains the concept of functions using examples but also covers various scenarios such as anonymous functions or passing functions around.
  13. Printing on Console in R – Printing on console can come very handy. The tutorial covers the print and cat functions as well as printing data frames.
  14. Pretty printing using Format function in R – This tutorial looks at how to use the formatting functions for pretty printing.
  15. Reshape and Reshape2 Package – Once you start working on real life problems in R, a lot of time would be spent on manipulating data. Reshape and Reshape2 package will prove very powerful in converting data to the format required by other libraries. This tutorial has detailed examples to explain the package.

These tutorials are designed for beginners in R, but they can also be used by experienced programmers as a refresher course or as reference. Running loops in R can be slow and therefore the apply group of functions as well as the reshape package can drastically improve the performance of the code.


Original Submission

 
This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 2) by janrinok on Sunday August 28 2016, @01:37PM

    by janrinok (52) Subscriber Badge on Sunday August 28 2016, @01:37PM (#394190) Journal

    R is the leading tool for statistics, data analysis, and machine learning. It is more than a statistical package; it's a programming language, so you can create your own objects, functions, and packages.

    I thought I had cleared that up in TFS....

    Starting Score:    1  point
    Karma-Bonus Modifier   +1  

    Total Score:   2