Search code examples
rdataframemachine-learningcluster-analysis

Error: object 'result' not found when clustering data


Here is the code:

n <- length(unique(data$vehicleType))
set.seed(42)
result <- kmeans(data.norm, n)
result

Error message:

Error: object 'result' not found

Solution

  • The following should do the job, based on the answers in the comments.

    set.seed(42)
    result <- kmeans(data.norm, 6)
    result