There are 14 bins in the histogram.
ggplot(wine) +
aes(x = color) +
geom_histogram(color = "black",
fill = "red",
bins = 14) +
labs(x = "Color intensity of the wine",
y = "Count")
Females wing size tends to be larger than males.
ggplot(damselfly) +
aes(x = Wing.size, fill = Sex) +
geom_density(alpha = 0.6) +
labs(x = " Wing size ") +
theme_classic()
This histogram is multimodal because it has only one peak.
ggplot(urine) +
aes(x = urea) +
geom_histogram(fill = "orange1",
color = "black",
size = 0.5,
bins = 3) +
labs(x = "Urea concentration",
y = "count")
Yes there exists a positive relationship between the two. As osmolarity increases, specific gravity increases as well.
ggplot(urine) +
aes(x = osmo,
color = pH,
y = gravity) +
geom_point(size = 3) +
geom_smooth(method = "lm") +
scale_color_viridis_c(option = "plasma") +
labs(x = "Osmolarity",
y = "Specific Gravity") +
theme_bw()
There is no relationship overall because the trend line is flat.
ggplot(pima) +
aes(x = bmi,
y = age,
color = diabetic) + # added color to aes to map color to diabetic
geom_point() +
scale_color_manual(values = c("darkorange2",
"black")) +
geom_smooth(method = "lm", color = "black") + # added color to trendline and used function "lm" for trendline
labs(x = "Body mass index of Women",
y = "Age of Women")
As urea concentration increase the likelihood of crystal formation of kidney stones is more likely to occur as seen as a higher density of those with crystals have a high concentration of urea.
ggplot(urine) +
aes(x = urea,
fill = crystal) +
geom_density(color = "black",
alpha = 0.90) +
scale_fill_brewer(palette = "PuRd") +
theme_classic() +
labs(x = "Urea Concentration", y = "Density")
Yes the BMI range of 60-67 the women did not have any pregnancies.
ggplot(pima) +
aes(x = bmi) +
geom_histogram(fill = "yellow",
color = "chocolate3", bins = 15) +
labs(x = "BMI", #labels
y = "Number of times a Women is Pregnant",
title = "Number of times a Women is Pregnant and their BMI's")
The highest insulin value for people with out diabetes is around 750.
ggplot(pima)+
aes(x=diabetic,
y=insulin,
fill=age)+
geom_jitter(shape=21,
alpha=0.7,
width=0.2)+
scale_fill_viridis_c(option="turbo")+
theme_bw()+
labs(x="Diabetes",
y="Insulin (μU/mL)")
Females choose their mate based on wing size, with the average male having a wing size of 1900.
ggplot(damselfly) +
aes(x = Wing.size, fill = Sex) +
scale_fill_brewer(palette = "Set3") +
geom_density(alpha = 0.8) +
facet_grid(vars(Mating.status)) +
theme_minimal() +
labs(x = "Wing size",
title = "Wing Size in Mating Pairs")
Abdomen length seems to play a role in damsel fly sexual selection, as those with smaller abdomens seem to be more likely to be mated. This was not what I actually expected.
ggplot(damselfly)+
aes(fill=Mating.status, y=Abdomen.length, x=Sex)+
geom_violin()+
labs(x="Fly sex",
y="Abdomen Length",
fill="Mating Status")+
scale_fill_brewer(palette="Pastel1")+
theme_light()