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

  • Home
  • SEARCH
  • 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 7960775
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:51:03+00:00 2026-06-04T04:51:03+00:00

Consider the following data file: column_name foo foo bar baz baz bar foo baz

  • 0

Consider the following data file:

column_name
foo
foo
bar
baz
baz
bar
foo
baz

How I can plot a histogram with using the lattice package, and sorting by a custom order (not alphabetic), e.g.: c('baz', 'foo', 'bar')?

  • 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-04T04:51:05+00:00Added an answer on June 4, 2026 at 4:51 am
    (histogram( y ~ x | factor(column_name, levels=c('baz', 'foo', 'bar') ) )
    

    Or perhaps:

    (histogram( y ~  factor(column_name, levels=c('baz', 'foo', 'bar') ) )
    

    Or even better put everything in a dataframe and then do:

    dfrm$column_name <-  factor(dfrm$column_name, levels=c('baz', 'foo', 'bar') ) )
    histogram( y ~ column_name, data=dfrm )
    

    (Lattice functions generally expect to have the main data arguments come from a dataframe.)

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

Sidebar

Related Questions

Consider this scenario: I've an XML file called person.xml with the following data in
Consider the following: package MyApp::CGI; use Moose; use MooseX::NonMoose; use Data::Dumper; extends 'CGI::Application'; BEGIN
Consider the following class in a file MyClass.cs using System; public class MyClass :
Consider a CSV file with the following data: weight,lat,long 9876,23.44,88.15 1234,27.11,55.33 .... What is
Consider the following sas code fragment: %macro temp(querystr=); filename request temp; data _null_; file
Consider the following snippet: >>> def foo(port, out, udp=False, ipv6=False, data=''): ... if not
Consider the following data structure: List<Person> People; class Person { List<Car> Cars; List<Hobby> Hobbies;
For my question lets consider the following sample table data: ProductID    ProductName    Price   Category 1                Apple                 5.00       Fruits
Consider the following two FFI structs: class A < FFI::Struct layout :data, :int end
OLEDB can be used to read and write Excel sheets. Consider the following code

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.