AN INTRODUCTION TO R
R> layout(matrix(1:2, nrow = 2)) R> hist(Forbes2000$marketvalue) R> hist(log(Forbes2000$marketvalue))
Histogram of Forbes2000$marketvalue
100 150 200 250
Histogram of log(Forbes2000$marketvalue)
Histograms of the market value and the logarithm of the market value for the companies contained in the Forbes 2000 list.
an R transcript file, for example analysis.R created with your favourite text editor, can be sourced into R using the source command
R> source("analysis.R", echo = TRUE)
When all steps of a data analysis, i.e., data preprocessing, transformations, simple summary statistics and plots, model building and inference as well as reporting, are collected in such an R transcript file, the analysis can be reproduced at any time, maybe with modified data as it frequently happens in our consulting practice.