Having Issues in Creating Time Series out of an unstructured dataset

Hi,
I am currently working on a data set that has yearly data for 4 different categories for example a,b,c and d. Now, this yearly data for each category has 20-25 number of observations (data in columns) depending on year and which category it is.
The problem that i am facing here is

  1. For this yearly data for a particular year (1900) category a has 5 records and out of those 3 records have 24 observations and 2 have 38 observations.
  2. Also, there is no particular sequence of years for which data have been recorded. Like, we have data for 1900,1901, 1902 and the staright we have data for year 1909.

So, given the above constraint, How should i proceed ahead to create a time series out of the given data frame of data. ?

Thanks
K

Hi!

To help us help you, could you please prepare a reproducible example (reprex) illustrating your issue? Please have a look at this guide, to see how to create one:

Attached is the sample data set out of the entire dataset that i am working on.
I uploaded this data in R studio and below is the code of lines that i tried to run.

R-Code

#Sort the data
sample.yearly <-sample.yearly[order(sample.yearly$Category, sample.yearly$Starting Year),]

#Create time series & plot
sample.yearly.ts = ts(sample.yearly)
plot(sample.yearly.ts) #just a plot

#Error
Error in plotts(x = x, y = y, plot.type = plot.type, xy.labels = xy.labels, :
cannot plot more than 10 series as "multiple"

My aim here is to create a time series for the attached dataset

  1. Based on each Category
  2. Time series as a whole dataset

Any pointers for this would be highly appreciated.

Thanks

That is not sample data, that is a screenshot (and not a good thing to do here), please read the link I gave you before and try to make a proper reproducible example.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.