This is a Notebook exploring a Biochemical Oxygen Demand dataset.
The dataset wwill be explored using basic R commands and outputs will be explained as follows.
View(BOD)
The output shows a table containing - 6 rows - 2 columns labelled “Time” and “demand”
head(BOD, n = 3)
The output above shows the time in days and their corresponding biological oxygen demand e.g Day 1 had a biological oxygen demand of 8.3. The head function selects the first three rows of the table.
summary(mtcars$mpg)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 10.40 15.43 19.20 20.09 22.80 33.90
The output shows the summary statisitcs of the mtcars dataset where the min value = 10.40 and max value = 33.90, the mean = 20.09, median = 19.20 and the first quartile = 15.43 ans third quartile = 22.80.
summary(c(3,2,1,2,4,6))
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 1.00 2.00 2.50 3.00 3.75 6.00
The output shows the summary statistics of a vector created using the values above. The function used above is called the combine function which combines the values to reproduce a vector.
str(c(1,2,3,4))
## num [1:4] 1 2 3 4
The output shows the length of the created vector and the values inside the vector.
str(c("Mon", "Tue","Wed","Thurs"))
## chr [1:4] "Mon" "Tue" "Wed" "Thurs"
The output displays a character vector containing strings. It shows the length of the vector and displays the characters in the vector.
head(c("Mon", "Tue","Wed","Thurs"),2)
## [1] "Mon" "Tue"
The output shows the first row of the dataset with the selected first 2 elements of the table.
tail(c("Mon", "Tue","Wed","Thurs"),2)
## [1] "Wed" "Thurs"
The output shows the last 2 strings in the table.
class(76.25L)
## [1] "numeric"
The output shows the word numeric which shows class type of the value given above. The given value is a float and not integer value.