Help continuing this code.

Hey guys. I am very new to Rstudio and need some help. How would you guys continue with this code and information? What more code can I use to explain the analysis better?


# Remove all rows with missing data
mcdonalds <- na.omit(mcdonalds)

# Calculate descriptive satistics
summary(mcdonalds)

# New dataset only including qualitative descriptives
qualitative <- mcdonalds %>%
  select(Calories, Fat, Sugars, Grams)

# How many clusters?
fviz_nbclust(mcdonalds[1:200, 3:6], kmeans, method = "wss")

# Fit a kmodel with 4 clusters
model1 <- kmeans(mcdonalds[, 3:6], centers = 4)
model1


# Add cluster membership to data frame
mcdonalds$cluster_membership_model1 <- model1$cluster

# Create a CrossTable between Category and membership
table(mcdonalds$Category, mcdonalds$cluster_membership_model1)

Hello
image

Did you take the time to read Welcome to the RStudio community ? It gives some hints about asking questions on this forum.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.