/rbasic

Teaching material for elementary R programming lecture

Primary LanguageR

Elementary R Programming


Lecturer: Ph.D. Bonsang Koo (bsk245@gmail.com)

Teaching Assistant: Changdong Oh(lamancha91@gmail.com)

July 31, 2017 ~ August 4, 2017

This lecture aims to introduce R for students who want to learn statistical analysis and reproducible research in R. Contents of the lecture are as follows.

Day 1: Basic Interface, Instructions, and Functions of R

The R user interface

Object Programming

assignment, help() and print()

Description of basic types of objects (vectors, lists, matrices, data frames) and classes (numeric, integer, logical, char, complex)

Vectors

length(), head(), tail(), sort(), sum(), rep()

Indices, logical indices

R library

How to install and Use R packages?

Day 2: Read and Write Data in R

Vectors and Matrices

Data Frames

various delimited input files

extracting data from R objects

Reading data files written in other programs (Excel, SPSS, Stata, etc.)

writing R objects to files

Factors

Characters

Day 3: Basic Visualization

Histograms

Scatter Plots

Lines

Texts

Legends

Setting plot parameters

Advanced Plotting

Lattice

trellis

ggplot2

Day 4: Basic Statistics

Mean

Standard Deviation

Summary

Table

correlation

t.test

chi-square test

Linear Models

Using R for simulation

Creating User-defined functions in R.

Day 5: Data Managing

Subscripting

Character Manipulation

Data Aggregation

Reshaping Data

Recoding Data

Creating New Variables

Transforming the Data

Converting Continuous Variables into Categorical ones

Merging multiple Datasets

apply, lapply, sapply

Introduction to more advanced data science with R

text data

image data

network data

bioinformatics