R for non programmers I.

R for non programmers I.

Sep 22, 2016. | Instructor: Lukáš Hejtmánek | At: NTK

Calendar Github

This two to three hour course is aimed at those who have never programmed and never worked with R. We will get into basics of what is a variable and a function and do simple vector math, sequencing, randomisation etc.

What we will do

We will learn basics of programming in R. What is a variable and what types of variables we have etc. The major part is going to be how to work with vectors, how to do comparisons and bunch of other stuff. This is mainly preparatory session for the data.frames lesson that follows.

What to do in advance?


Have your notebooks ready to do some R programming. That includes following steps:

  1. Download R from https://cran.r-project.org/src/base/R-3/

  2. Install R and open it. Check if everything is fine by running following commands (just copy paste it one by one to the command line) to check:

    install.packages('dplyr') #installs package
    
    library(dplyr) #loads the package
    
    head(iris) #inspects head of a dataset that comes with R
    
    iris %>% filter(Species == "virginica") %>% select(Sepal.Width, Species) #filters dataset
    
    iris %>% filter(Species == "virginica")  %>% summarise(mean = mean(Sepal.Width), sd = sd(Sepal.Width)) #calculates summary stats on the filtered dataset
    
  3. If you have any trouble running above code, message somebody on slack in the #r-help channel

  4. Download and install RStudio

  5. Check if the above commands run in the RStudio as well.

  6. Wait :)

Important

You will need your own PC with wi-fi module and eduroam access or other internet access that NTK provides. I can’t stress that enough. there is no free Wi-fi in NTK. You either have to have an NTK account or need access to eduroam. If you are PhD sutdents, you should have euroam account provided by your university.

About

Community to help non programming graduate students with their programming projects. Promoting clean, readible and shareable scientific code.

Social Links

Site deveoloment

This site is built with the help of the amazing Jekyll ruby gem and the Solid-Jekyll template. Check it out!