Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4049402
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T13:56:26+00:00 2026-05-20T13:56:26+00:00

From a previous question on the R-list, I saw two approaches for examining packages

  • 0

From a previous question on the R-list, I saw two approaches for examining packages that are loaded in:

ls("package:ts") 
lsf.str("package:ts")

In my case, I want to examine what the output of kmeans is, which is a function in the stats package, so I used:

lsf.str("package:stats")

However, I don’t know how to examine what is returned from this command. I want to identify the parameters used in a previous clustering, so that I can apply them to another dataset. Where I can find the parameters that are stored as part of this function?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T13:56:27+00:00Added an answer on May 20, 2026 at 1:56 pm

    The Value section of the kmeans help page lists the format of the object returned byt he function :

    An object of class ‘”kmeans”’ which has a ‘print’ method and is a
    list with components:

    cluster: A vector of integers (from
    ‘1:k’) indicating the cluster to
    which each point is allocated.

    centers: A matrix of cluster centres.

    withinss: The within-cluster sum of
    squares for each cluster.

    totss: The total within-cluster sum
    of squares.

    tot.withinss: Total within-cluster sum
    of squares, i.e.,
    ‘sum(withinss)’.

    betweenss: The between-cluster sum of
    squares.

    size: The number of points in each cluster.

    In general you can also list these values directly from your kmeans object with the names function :

    R> names(km)
    [1] "cluster"      "centers"      "totss"        "withinss"    
    [5] "tot.withinss" "betweenss"    "size"      
    

    From the description of the values in the help page, I would say that the parameters used for the clustering are not stored in the resulting object. So if you only have access to the resulting kmeans object and not to the original function call, I would say that these parameters are lost, unfortunately…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This question follows on from a previous question, that has raised a further issue.
From My Previous question sending request to apple - from iphone custom application Here,
From a previous question on Stackoverflow Iterating through/Parsing JSON Object via JavaScript .... My
From my previous question about timezones , I decided to use the Ruby gem
This stems from a previous question I asked - about a write conflict with
Following up from my previous question , why is CShell so different from C?
Thanks to suggestions from a previous question , I'm busy trying out IronPython, IronRuby
Following on from a previous question, for some reason when I use the following
Following on from a previous question relating to heap usage restrictions , I'm looking
Following on from a previous question , I am creating a symbolic link on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.