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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:52:14+00:00 2026-06-11T09:52:14+00:00

When missing data is present or there is a large gap in the dates,

  • 0

When missing data is present or there is a large gap in the dates, ggplot produces a discontinuous line.

Eg:

enter image description here

    q.data<-structure(list(date = structure(c(15544, 15546, 15547, 15548, 
15550, 15552, 15554, 15556, 15575, 15580, 15587, 15588, 15589, 
15593, 15596), class = "Date"), data = c(NA, 0.2, 0.2, 0.3, 0.6, 
0.7, 0.8, 0.9, NA, NA, 1, 1, 1.1, 1.7, 2)), .Names = c("date", 
"data"), row.names = c(NA, -15L), class = "data.frame")

q.data$date<-as.Date(q.data$date, format="%Y-%m-%d")

q.plot<-qplot(data=q.data,
              x=date,
              y=data)+geom_line()

print(q.plot)

I am looking for a way to force a continuous line.

  • 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-11T09:52:15+00:00Added an answer on June 11, 2026 at 9:52 am

    I don’t think it really happens with a large gap in the dates, in the absence of NAs. The NA values seem to be your problem.

    I think

    q.plot <- qplot(data=na.omit(q.data),...) 
    

    should work, but what I tried (which worked) was

    print(q.plot %+% na.omit(q.data))
    

    enter image description here

    PS: 1. it would be slightly nicer to use dput to post your data. 2. My solution also gets rid of NA values at the beginning and end of the series, which could conceivably be problematic …

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

Sidebar

Related Questions

Table structure - Data present for 5 min. slots - data_point | point_date 12
Say we have the following simple data-frame of date-value pairs, where some dates are
missing data are represented as 9999.00 , 9999.0 and 9999.000 in a text file.
I have some failing builds and the build data is missing from the emails
This works but for some reason the comma is missing. data gets inserted as
As you would expect from a DSL aimed at data analysis, R handles missing/incomplete
I got a bunch of data in a database. The goal is to present
In my word game there is a list of words in a <ul> that
Im learning some JSON, Im trying to list some data about dogs from twitter...but
Given a table (TableA) that contains the following data; Id Date Status RecordId 1

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.