# load the csv file, ignoring the header
mainDir <- "C:/workspace/ecdf"
setwd(mainDir)
mainDir <- getwd()
rawCSVFile <- "heap.csv"
rsm <- read.csv(rawCSVFile,header=TRUE)
# check structure and convert vector values to numeric
str(rsm)
rsm$HEAP <- as.numeric(rsm$HEAP)
# calculate the mean and standard deviation
mean <- mean(rsm$HEAP)
sd <- sd(rsm$HEAP)
#plotting the density function of a normal distribution
heap <- rsm$HEAP
# plot the data
plot(heap, dnorm(heap, mean, sd), type="l")
No comments:
Post a Comment