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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:08:48+00:00 2026-06-14T05:08:48+00:00

I am trying to plot a simple time series using ggplot() or qplot() .

  • 0

I am trying to plot a simple time series using ggplot() or qplot(). The horizontal axis will be the date and the vertical axis a number, a simple line chart will suffice.
Normally, one would need to melt the rectangle data before using ggplot(). However, I am stuck with this:

net.t <- structure(c(6, 11, 0, -1, -13), .Names = c("2011-09-01", "2011-12-01", 
"2012-03-01", "2012-06-01", "2012-09-01"))

net.t.m <- melt(net.t,id="var")

#After melting 'net.t', it became a vector or array? how to plot that?

qplot(net.t.m,main="Net Promotion Score")+geom_smooth(se=F, size=1.5)
nps.t+labs(y="NPS",x="Year Quarter")+geom_text(aes(label =value),size = 3, vjust = -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-14T05:08:49+00:00Added an answer on June 14, 2026 at 5:08 am

    Your net.t is just a vector and once you melt it, you have a data frame with only one column. The dates are the names of the rows, not the entries. One solution is to add a column of dates:

    net.t.m$date <- as.Date(rownames(net.t.m))
    ggplot(net.t.m, aes(x=date, y=value)) + geom_point() +
       geom_smooth(method="loess", se=F, size=1.5) +
       labs(y="NPS",x="Year Quarter") +
       geom_text(aes(label =value),size = 3, vjust = -1)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using ggplot2 to plot simple line charts of time series data. One
I'm trying to create a pretty simple scatter plot with two data series. I
I'm trying to plot a step chart with the following properties: x-axis: Time (ms)
I'm using GD to plot some simple charts from array point data.. Trying to
I'm using Sparklines and am trying to draw a simple blox plot with predetermined
I am trying to create a simple line plot and jitter the lines. library(ggplot2)
I'm trying to plot values as a function of the date (only hh:mm:ss, without
I am trying to plot a graph using gnuplot. I have six text files.
I am trying to plot some data using pylab scatter function. I'm using pylab.scatter(X,
I'm trying to display a chart titled Purchases over Time using Highcharts in my

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.