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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:41:41+00:00 2026-06-11T17:41:41+00:00

I am trying to get a simple bar char of activity count by date;

  • 0

I am trying to get a simple bar char of activity count by date; however, when I import my data into R, it either skipping some record or not properly converting the date format.

Here is the script I am using:

ua <- read.table('report_users_activities_byrole 2.txt',sep='|',header=T)
qplot(date, 
      data=ua, 
      geom="bar", 
      weight=count, 
      ylab="User Count", 
      fill=factor(un_region)) + 
    opts(axis.text.x =theme_text(angle=45, size=5))

And my date

    head(ua)

        date                 role                                         name   un_region                un_subregion               us_state count
1  2012-06-21   ENTREPRENEUR         Australia                                    Oceania     Australia and New Zealand                             2
2  2012-06-21   ENTREPRENEUR         Belgium                                      Europe      Western Europe                                        1
3  2012-06-21   ENTREPRENEUR         Bosnia and Herzegovina                       Europe      Southern Europe                                       1
  • 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-11T17:41:43+00:00Added an answer on June 11, 2026 at 5:41 pm

    Not sure what’s wrong with your code but something like this should work (that’s a version of the example at http://had.co.nz/ggplot2/scale_date.html)

    df = data.frame(date=sample(seq(Sys.Date(), len=100, by="1 day"),size=100,replace=TRUE))
    qplot(x=date,data=df,geom="bar")
    

    df is a data.frame where some dates appear more often than others (that’s the sample() function). not sure why you want the “weight” argument in your qplot() call. Also make sure your date variable is a proper date (not a string), i.e. do

    str(df$date)
    

    otherwise

        qplot(x=factor(date),data=df,geom="bar")
    

    should work as well.

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

Sidebar

Related Questions

I am trying to get simple Progress bar when I clicking on item list
I'm trying to get a simple test going with QUnit but for some reason
I am using Simple DOM Parser and I am trying to get some info
This should be simple. I am trying to get a grey bar in a
I am trying to get some data from a database on the fly and
I'm trying to get a simple solution for this layout. This is the simplified
I'm trying to get this simple program to work on windows, but it crashes:
I'm trying to get a simple winsock program working, so I create my socket
I'm trying to get a simple socket.io server running: Client: <script src=http://www.my-server.com:8080/socket.io/socket.io.js></script> var socket
I'm trying to get a simple VBO running. But when i call glBufferData(GL_ARRAY_BUFFER, sizeof(Vertex)*vertexcount,

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.