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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T11:42:42+00:00 2026-06-06T11:42:42+00:00

Exploring a new data set: What is the easiest, quickest way to visualise many

  • 0

Exploring a new data set: What is the easiest, quickest way to visualise many (all) variables?

Ideally, the output shows the histograms next to each other with minimal clutter and maximum information. Key to this question is flexibility and stability to deal with large and different data sets. I’m using RStudio and usually deal with large and messy survey data.

One example which comes out of the box of Hmisc and works quite well here is:

library(ggplot2)
str(mpg)

library(Hmisc)
hist.data.frame(mpg)

Unfortunately, somewhere else I run into problems with data lables (Error in plot.new() : figure margins too large). It also crashed for a larger data set than mpg and I haven’t figured out how to control binning. Moreover, I’d prefer a flexible solution in ggplot2. Note that I just started learning R and am used to the comfortable solutions provided by commercial software.

More questions on this topic:

R histogram – too many variables

…?

  • 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-06T11:42:44+00:00Added an answer on June 6, 2026 at 11:42 am

    There may be three broad approaches:

    1. Commands from packages such as hist.data.frame()
    2. Looping over variables or similar macro constructs
    3. Stacking variables and using facets

    Packages

    Other commands available that may be helpful:

    library(plyr)
    library(psych)
    multi.hist(mpg) #error, not numeric
    multi.hist(mpg[,sapply(mpg, is.numeric)])
    

    or perhaps multhist from plotrix, which I haven’t explored. Both of them do not offer the flexibilty I was looking for.

    Loops

    As an R beginner everyone advised me to stay away from loops. So I did, but perhaps it is worth a try here. Any suggestions are very welcome. Perhaps you could comment on how to combine the graphs into one file.

    Stacking

    My first suspicion was that stacking variables might get out of hand. However, it might be the best strategy for a reasonable set of variables.

    One example I came up with uses the melt function.

    library(reshape2)
    mpgid <- mutate(mpg, id=as.numeric(rownames(mpg)))
    mpgstack <- melt(mpgid, id="id")
    pp <- qplot(value, data=mpgstack) + facet_wrap(~variable, scales="free")
    # pp + stat_bin(geom="text", aes(label=..count.., vjust=-1))
    ggsave("mpg-histograms.pdf", pp, scale=2)
    

    (As you can see I tried to put value labels on the bars for more information density, but that didn’t go so well. The labels on the x-axis are also less than ideal.)

    No solution here is perfect and there won’t be a one-size-fits-all command. But perhaps we can get closer to ease exploring a new data set.

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

Sidebar

Related Questions

I'm new to WinRT and was exploring it's security features and I've got a
Being new to Ada, I'm exploring its syntax and rules and I would like
my report has no header and footer. my report shows show data according to
I'm new to Azure, and exploring it for my company's internal company site. We've
I am very new to Apache camel and I am exploring how to create
I am new to web service and I am exploring one particular idea regarding
I am new to Linq world and currently exploring it. I am thinking about
Hi all and thanks in advance. I am new to the NoSQL game but
There were many questions about C++ template classes which contain static member variables, as
I am exploring the idea of implementing a web service api using WCF Data

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.