This is an R Markdown document. The only goal is to show the very basic statistical computations in R.

To retrieve the dataset used in this script, it is needed the package downloader. By using the download command contained in such a package, it is possible to access a dataset which is behind a secured web site (https). So the first steep is to call the downloader package which must be already installed.

require(downloader)
## Loading required package: downloader

Once loaded to the session, it is possible to retrieve a dataset from an https site. In this script it is retrieved a .RData type dataset which is the R native data type.

download("https://dl.dropboxusercontent.com/u/95175494/datasets/DayTemp.RData", destfile="DayTemp.RData")
load("DayTemp.RData")
attach(DayTemp)
DayTemp
##    Day Temper
## 1    1     24
## 2    2     35
## 3    3     17
## 4    4     21
## 5    5     24
## 6    6     37
## 7    7     26
## 8    8     46
## 9    9     58
## 10  10     31
## 11  11     32
## 12  12     13
## 13  13     12
## 14  14     38
## 15  15     41
## 16  16     43
## 17  17     44
## 18  18     27
## 19  19     53
## 20  20     27

The command to compute the mean:

mean(Temper)
## [1] 32.45

The command to compute the median:

median(Temper)
## [1] 31.5

The command for the mode…

Well, in R, mode() tells the internal storage mode of the R object, not the value that occurs the most in its argument. So, to know the mode we need to install and call modeest package, then execute the mlv:

library(modeest)
## 
## This is package 'modeest' written by P. PONCET.
## For a complete list of functions, use 'library(help = "modeest")' or 'help.start()'.
mlv(Temper)
## Mode (most frequent value): 24 27 
## Bickel's modal skewness: 0.4 
## Call: mlv.integer(x = Temper)

The command for the variance:

var(Temper)
## [1] 160.3658

The command for the Standard Deviation:

sd(Temper)
## [1] 12.66356

With the command summary it is possible to obtain the most important measurements at one time:

summary(Temper)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   12.00   24.00   31.50   32.45   41.50   58.00

Next, a very basic plot is generated, indeed, the only parameter needed is the dataset:

par(bg = "cornsilk")
boxplot(Temper, horizontal=TRUE, col="lavender")
title(main="Box Plot for the Isolated Windows Store", col.main="darkblue",xlab="Temperature in °F",col.lab="blue",cex.lab=0.80,sub="Graphic by Carlos Rodriguez, PhD",col.sub="red",cex.sub=0.7)

par(bg = "white")