Welcome, Bienvenue, Willkommen, 歡迎

Menulis Kode R yang Efisien

Colin Gillespie

Jumping Rivers & Newcastle University

Menulis Kode R yang Efisien

Menulis Kode R yang Efisien

A typical R workflow

# Load
data_set <- read.csv("dataset.csv")

# Plot plot(data_set$x, data_set$y)
# Model lm(y ~ x, data = data_set)
Menulis Kode R yang Efisien

When to optimize

Premature optimization is the root of all evil

Popularized by Donald Knuth

Menulis Kode R yang Efisien

R version

  • v2.0 Lazy loading; fast loading of data with minimal expense of system memory.
    • v2.13 Speeding up functions with the byte compiler
    • v3.0 Support for large vectors
  • Main releases every April

    • e.g., 3.0, 3.1, 3.2
  • Smaller bug fixes throughout the year

    • e.g., 3.3.0, 3.3.1, 3.3.2
Menulis Kode R yang Efisien

Let's practice!

Menulis Kode R yang Efisien

Preparing Video For Download...