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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:17:00+00:00 2026-05-23T15:17:00+00:00

I have a time series(a csv file) data that looks like below. Each observation

  • 0

I have a time series(a csv file) data that looks like below. Each observation is spaced at interval of 2 seconds :

Group,Id, Observations (illustration only--csv file dont have headers)
A,21,2,3,4
B,12,2,9
C,13,3,5
A,14,4,6,7,9,12,3,4,5,6
B,15,3,5,2,1,3
C,16,8,67
A,27,98,78
B,18,2,3,4,5,6,7,8,1,2,3,4,5
C,19,2,3,4,5,6,6,4,3,3,2,3,4,4,5,6,66,6,4,3,232

Each row is a separate time series data. I am trying to compare and contrast these time series data w.r.t group(A,B,C) with some plots(at least for now).

Edit :
I read the csv file as suggested in Import data into R with an unknown number of columns? which would read this csv as

 X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12 X13 X14 X15 X16 X17 X18 X19 X20 X21  X22
  A 21  2  3  4 NA NA NA NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA
  B 12  2  9 NA NA NA NA NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA
                      ---------------------------
  C 19  2  3  4  5  6  6  4   3   3   2   3   4   4   5   6  66   6   4   3  232

I tried to plot this data with ggplot by melting the data with

melt(data,c("X1","X2")) 

which gives me result

    X1 X2   variable value
1    A 21       X3     2
2    B 12       X3     2
3    C 13       X3     3
4    A 14       X3     4
5    B 15       X3     3
6    C 16       X3     8
7    A 27       X3    98
8    B 18       X3     2
9    C 19       X3     2
10   A 21       X4     3
11   B 12       X4     9
12   C 13       X4     5
13   A 14       X4     6
14   B 15       X4     5
15   C 16       X4    67
----------------------

X3,X4,X5..X22 are observation over period of time.
I want to compare different groups(A,B,C) of data by independently plotting each observations(or say create time series for each observation).
I could not figure out plotting solution with zoo package. I was wondering how such plot can be generated for this type of time series data?

  • 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-23T15:17:01+00:00Added an answer on May 23, 2026 at 3:17 pm

    Try this:

    Lines <- "A,21,2,3,4
    B,12,2,9
    C,13,3,5
    A,14,4,6,7,9,12,3,4,5,6
    B,15,3,5,2,1,3
    C,16,8,67
    A,27,98,78
    B,18,2,3,4,5,6,7,8,1,2,3,4,5
    C,19,2,3,4,5,6,6,4,3,3,2,3,4,4,5,6,66,6,4,3,232"
    
    library(zoo)
    k <- max(count.fields(textConnection(Lines), sep = ","))
    DF <- read.table(textConnection(Lines), sep = ",", fill = TRUE, col.names = 1:k, 
       as.is = TRUE)
    
    # next line may not be needed but won't hurt
    DF[[1]] <- gsub(" ", "", DF[[1]])
    
    z <- zooreg(t(DF[-1]), start = 0, deltat = 2)
    
    plot(z, screen = DF[[1]])
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have various time-series I'd like to correlate and present as either a csv-file
I have a variety of time-series data stored on a more-or-less georeferenced grid, e.g.
I have a table of time-series data of which I need to find all
I'm developing an app that handle sets of financial series data (input as csv
Suppose if I have a random time series that I want to interpolate over
I have a vector containing simple time series data (extracted from a deSolve matrix),
I have to apply regression function progressively to a time series data (vector time
I have imported a time series with dates of the following format: test =
I have a time represented as the number of seconds elapsed since midnight, January
I have a list of vectors which are time series of inequal length. 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.