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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:32:08+00:00 2026-05-26T12:32:08+00:00

I am relatively new to R and am having trouble plotting grouped data against

  • 0

I am relatively new to R and am having trouble plotting grouped data against date. I have count data grouped by month over 4 years. I don’t want May of 2008 grouped with May 2009 but rather points for each month of each year with standard errors. Here is my code so far but I get a blank graph with no points. I can get rid of the axis.POSIXct line and I get a graph with points and error bars. The problem seems to be around the scaling or data format of the plot vs. the axis. Can anyone help me here?

> r <- as.POSIXct(range(refmCount$mo.yr), "month")
> 
> ############# can get plot and points to line up on the x-axis##########################
> plot(refmCount$mo.yr, refmCount$count, type = "n", xaxt = "n",
+      xlab = "Date",
+      ylab = "Mean number of salamanders per night",
+      xlim = c(r[1], r[2]))
> axis.POSIXct(1, at = seq(r[1], r[2], by = "month"), format = "%b")
> points(refmCount$mo.yr, refmCount$count, type = "p", pch = 19)
points(depmCount$mo.yr, depmCount$count, type = "p", pch = 24)
> arrows(refmCount$mo.yr, refmCount$count+mCount$se, refmCount$mo.yr, refmCount$count-  refmCount$se, angle=90, code=3, length=0)
 > 
> str(refmCount)
'data.frame':   19 obs. of  7 variables:
$ mo.yr:Class 'Date'  num [1:19] 14000 14031 14061 14092 14123 ...
$ trt  : Factor w/ 2 levels "Depletion","Reference": 2 2 2 2 2 2 2 2 2 2 ...
$ N    : num  75 110 15 10 34 20 20 10 40 15 ...
$ count: num  3.6 5.95 3.47 6.7 11.12 ...
$ sd   : num  8.58 8.4 4.42 3.47 11.88 ...
$ se   : num  0.99 0.801 1.142 1.096 2.037 ...
$ ci   : num  1.97 1.59 2.45 2.48 4.14 ...
> r
[1] "2008-04-30 20:00:00 EDT" "2011-05-31 20:00:00 EDT"
>
  • 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-26T12:32:09+00:00Added an answer on May 26, 2026 at 12:32 pm

    You have two choices. Install package “zoo” and use the yearmon class, or calculate numeric months so that May 2005 is 2005.4167. You can create prettier labels with paste(month.abb[month], year).

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

Sidebar

Related Questions

I'm relatively new to JavaScript and I've been having trouble pushing data into an
I'm relatively new to C++ and am having a hard trouble understanding the instantiation
I am relatively new to C++ and am having problems understanding struct. I have
I'm relatively new to MongoDB and having trouble with a more advanced upsert. I've
I'm (needless to say) relatively new to CSS3 and I'm having trouble with aligning
I'm relatively new to ASP.NET MVC so I'm having a little trouble with this
I am relatively new to PHP/MySQL and have been having a problem that I
I'm new to vbscript and I'm having trouble with something that should be relatively
I am relatively new to R and am having some trouble with how to
I’m an experienced developer, but relatively new to iOS. I’m having some trouble with

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.