Time series data-R programming

Discussion in 'Masters Program - Customers only' started by Padma_12, Nov 5, 2017.

  1. Padma_12

    Padma_12 Member
    Alumni

    Joined:
    Apr 13, 2017
    Messages:
    12
    Likes Received:
    0
    Time Series:
    Start = 1821
    End = 1934
    Frequency = 1
    [1] 269 321 585 871 1475 2821 3928 5943 4950 2577 523 98 184
    [14] 279 409 2285 2685 3409 1824 409 151 45 68 213 546 1033
    [27] 2129 2536 957 361 377 225 360 731 1638 2725 2871 2119 684
    [40] 299 236 245 552 1623 3311 6721 4254 687 255 473 358 784
    [53] 1594 1676 2251 1426 756 299 201 229 469 736 2042 2811 4431
    [66] 2511 389 73 39 49 59 188 377 1292 4031 3495 587 105
    [79] 153 387 758 1307 3465 6991 6313 3794 1836 345 382 808 1388
    [92] 2713 3800 3091 2985 3790 674 81 80 108 229 399 1132 2432
    [105] 3574 2935 1537 529 485 662 1000 1590 2657 3396.
    ------------------------------------------
    This data is in .xlsx file. I want to read this data and plot it using R.

    This is my code
    td<-scan("Time series.xlsx",skip=3)
    It is showing following error
    Error in scan("Time series.xlsx", skip = 3) : scan() expected 'a real', got '��Y��Yux'
     
    #1
  2. Priyanka_Mehta

    Priyanka_Mehta Well-Known Member
    Simplilearn Support

    Joined:
    May 25, 2017
    Messages:
    726
    Likes Received:
    50
    Hi Padma,

    Apologies for the delay is response.

    Kindly find the below mentioned explanation:
    While reading numeric values, then just use
    scan("/PathTo/file.csv")
    scan by default will use white space as separator. The type of the second arg defines 'what' to read (defaults to double()).

    I hope this will help you.

    Regards,
    Priyanka
    GTA - Simplilearn
     
    #2

Share This Page