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 8073607
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T14:23:03+00:00 2026-06-05T14:23:03+00:00

I saw these codes from here: http://learnr.wordpress.com/2009/08/10/ggplot2-version-of-figures-in-lattice-multivariate-data-visualization-with-r-part-9/ hc1 <- hclust(dist(USArrests, method = canberra)) hc1

  • 0

I saw these codes from here: http://learnr.wordpress.com/2009/08/10/ggplot2-version-of-figures-in-lattice-multivariate-data-visualization-with-r-part-9/

hc1 <- hclust(dist(USArrests, method = "canberra"))
hc1 <- as.dendrogram(hc1)
ord.hc1 <- order.dendrogram(hc1)
hc2 <- reorder(hc1, state.region[ord.hc1])
ord.hc2 <- order.dendrogram(hc2)
region.colors <- trellis.par.get("superpose.polygon")$col
USArrests2 <- melt(t(scale(USArrests)))
USArrests2$X2 <- factor(USArrests2$X2, levels = state.name[ord.hc2])

But I’m very confused in the forth line about the state.region variable.

The variable about the order is ord.hc1 was generated from USArrests, which seems to have nothing to do with state.region. Then why it uses state.region for reordering instead of a column within USArrests data frame?

  • 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-06-05T14:23:05+00:00Added an answer on June 5, 2026 at 2:23 pm

    Look at the help file for state.region –

    ?state.region
    

    The first sentence under Details, is

    R currently contains the following "state" data sets.  
    Note that all data are arranged according to alphabetical 
    order of the state names.
    

    This means that we can jump between the USA data sets, since they are all in the same order, i.e. the state of the first entry of the USArrests is the same as the state in state.region.

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

Sidebar

Related Questions

So here's some code on http://groups.google.com/group/android-developers/browse_thread/thread/16a2216b39513674 in which the poster writes that he's shortened
I'm using amcharts flash at the moment. see here: http://www.myinvestmentdecision.com.au/Sample-Results I want to change
I was going through a book studying Linked list and saw these lines if(
I am trying to call the rx 2.0 frameworok from fsharp. I saw there
So I saw this post here and read it and it seems like bulk
I was looking over old MIX-videos from 2007 and saw a nice presentation showing
As i saw on this page http://www.labnol.org/internet/embed-youtube-videos-logoless/19532/ about how to hide youtube logo from
I saw a cute demonstration of tweeting from R in a presentation some months
I'm making a javascript/canvas game and I saw this example on CSS Tricks. Here's
this is page i'm currently working on: http://devel.spoorle.com/poc/ At the bottom there is a

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.