Uploaded by omar.oulloa

Claw lengths Data

advertisement
Mini Assignment #3
BI393
Omar Orlando Ulloa
170463640
FIGURE 1.0 histogram of male crayfish claw lengths
Mean claw length is 34.74mm
Geometric mean is 33.22mm
Harmonic mean 31.72mm
Shapiro-wilk normality test
W = 0.947, p-value = 0.0598
p value > 0.05 Therefore data is a normal distribution
CODE & ANNOTATIONS
setwd("C:/Users/omaro/OneDrive/Desktop/R projects") #Setting working Directory
crayfish <- read.csv ("crayfish.csv", header = TRUE, sep = ",",stringsAsFactors = TRUE)
attach(crayfish)
#Loading Crayfish Data into R
hist(claw.length, ylim =c(0, 6), breaks=(15) , xlim =c(10,60), xlab = "CLAW LENGTH (mm)",
main = "", ylab = "FREQUENCY", col = "black",)
library(psych)
#library(psych) is to access extra functions
#ylim is to change the limits of the Y axis
#breaks is to change the dimensions of the bars on the histogram
#xlim is to change the limits of the X axis
#xlab is to change the label of the X axis
#ylab is to change the label of the Y axis
#main is to change the title of the histogram
#col is to change the color of the bars of the histogram
mean(claw.length)
#To find the mean claw length
geometric.mean(claw.length)
#To find the geometric mean
harmonic.mean(claw.length)
#To find the harmonic mean of the claw length
shapiro.test(claw.length)
#To find the result of shapiro test
Download