library(plyr)## Warning: package 'plyr' was built under R version 4.0.4
library(tidyverse)## Warning: package 'ggplot2' was built under R version 4.0.4
library(openintro)
library(ggplot2)
library(lattice)## Warning: package 'lattice' was built under R version 4.0.4
#library(reshape)
#library(reshape2)library(plyr)
library(tidyverse)
library(openintro)
library(ggplot2)
library(lattice)
#library(reshape)
#library(reshape2)Answers I am not sure how to group in “classes,” so I created a histogram in R as seen below. The shape of the histogram is a bit right skewed, so it would be non-normal and support the criticism in part a.
# Create the Cell data frame.
cell.data <- data.frame(
cell_id = c (1:36),
cell_count = c("38","42","25","35","35","33","48","53","17","24","26","26","47","28","24","35","38","26","38","29","49","26","41","26","35","38","44","25","45","28","31","46","32","39","59","53"))
cell.data## cell_id cell_count
## 1 1 38
## 2 2 42
## 3 3 25
## 4 4 35
## 5 5 35
## 6 6 33
## 7 7 48
## 8 8 53
## 9 9 17
## 10 10 24
## 11 11 26
## 12 12 26
## 13 13 47
## 14 14 28
## 15 15 24
## 16 16 35
## 17 17 38
## 18 18 26
## 19 19 38
## 20 20 29
## 21 21 49
## 22 22 26
## 23 23 41
## 24 24 26
## 25 25 35
## 26 26 38
## 27 27 44
## 28 28 25
## 29 29 45
## 30 30 28
## 31 31 31
## 32 32 46
## 33 33 32
## 34 34 39
## 35 35 59
## 36 36 53
# Create frequency table from data frame
set.seed(0)
#table(df$cell_count)
cell.data %>% count(cell_count)## cell_count n
## 1 17 1
## 2 24 2
## 3 25 2
## 4 26 5
## 5 28 2
## 6 29 1
## 7 31 1
## 8 32 1
## 9 33 1
## 10 35 4
## 11 38 4
## 12 39 1
## 13 41 1
## 14 42 1
## 15 44 1
## 16 45 1
## 17 46 1
## 18 47 1
## 19 48 1
## 20 49 1
## 21 53 2
## 22 59 1
samp <- c(38,42,25,35,35,33,48,53,17,24,26,26,47,28,24,35,38,26,38,29,49,26,41,26,35,38,44,25,45,28,31,46,32,39,59,53)
sample_mean <- mean(samp)
sample_mean## [1] 35.66667
se <- sd(samp) / sqrt(36)
se## [1] 1.664284
lower <- sample_mean - 2.042 * se
upper <- sample_mean + 2.042 * se
c(lower, upper)## [1] 32.26820 39.06513
#create a histogram from a frequency table
hist(samp,
main ="Histogram - Number of Dendritic Branches",
bins <- seq(15,60,by=5),
border = "Green",
col = "Orange" ,
summary(samp))## Warning in if (freq) x$counts else x$density: the condition has length > 1 and
## only the first element will be used
## Warning in if (!freq) "Density" else "Frequency": the condition has length > 1
## and only the first element will be used
samp## [1] 38 42 25 35 35 33 48 53 17 24 26 26 47 28 24 35 38 26 38 29 49 26 41 26 35
## [26] 38 44 25 45 28 31 46 32 39 59 53