abalone <- read.csv("C:/Users/qkrgp/Documents/RData/abalone.csv")
결과 이미지 :
head 확인
head(abalone)
결과 이미지 :
categorical_vars <- sapply(abalone, is.factor)
결과 이미지 :
lapply(abalone[categorical_vars], unique)
수행결과 : named list()
boxplot(Rings ~ Age, data = abalone, main = "Rings by Age", xlab = "Age", ylab = "Rings")
결과 이미지 :
boxplot(Diameter ~ Age, data = abalone, main = "Diameter by Age", xlab = "Age", ylab = "Diameter")
결과 이미지 :
melted_abalone <- melt(abalone, id.vars = c("Age", "Length", "Diameter", "Height", "Rings"),
measure.vars = c("Whole_Weight", "Shucked_Weight", "Viscera_Weight", "Shell_Weight"))
ggplot(melted_abalone, aes(x = Age, y = value, fill = Age)) +
geom_boxplot() +
facet_wrap(~variable, scales = "free_y") +
labs(title = "Weight Distribution by Age", x = "Age", y = "Weight")
결과 이미지 :
pairs(~Whole_Weight + Length + Diameter + Height, data = abalone, main = "Relationships between Whole Weight and Dimensions")
결과 이미지 :
pairs(~Length + Diameter + Height + Whole_Weight + Shucked_Weight + Viscera_Weight + Shell_Weight,
data = abalone,
main = "Scatterplot Matrix of Continuous Variables")
결과 이미지 :