{"id":2007,"date":"2018-02-21T09:56:31","date_gmt":"2018-02-21T04:26:31","guid":{"rendered":"http:\/\/stepbystepschools.net\/?p=2007"},"modified":"2018-02-21T09:56:31","modified_gmt":"2018-02-21T04:26:31","slug":"data-science-training-in-mumbai-simple-time-series-example-using-r-language","status":"publish","type":"post","link":"https:\/\/www.stepbystepschools.net\/?p=2007","title":{"rendered":"Data Science Training in Mumbai :- Simple Time Series Example using R Language."},"content":{"rendered":"<p>A time series is a sequence of numerical data points which are represented in successive order.<\/p>\n<p>In Investment and Capital, a time series tracks the movement of the chosen data points, such as a security\u2019s price, over a specified period of time with data points recorded over a regular intervals.<\/p>\n<p>In Time Series there is no minimum or maximum amount of time that must be included thus allowing the data to be gathered in a way that provides the information being sought by the investor or analyst examining the activity.<\/p>\n<p><a href=\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2018\/02\/1-5.jpg\" rel=\"attachment wp-att-2008\"><img loading=\"lazy\" src=\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2018\/02\/1-5.jpg\" alt=\"1\" width=\"622\" height=\"341\" class=\"aligncenter size-full wp-image-2008\" srcset=\"https:\/\/www.stepbystepschools.net\/wp-content\/uploads\/2018\/02\/1-5.jpg 622w, https:\/\/www.stepbystepschools.net\/wp-content\/uploads\/2018\/02\/1-5-300x164.jpg 300w\" sizes=\"(max-width: 622px) 100vw, 622px\" \/><\/a><\/p>\n<p><b>Initial Environment Setup<\/b><\/p>\n<p>But before we get into creating a program let\u2019s just first set up a proper environment for R programming.<\/p>\n<p>To install R programming tool go to the following link and download the software and install it.<\/p>\n<p>For Windows Users:<\/p>\n<p><a target=\"_blank\" href=\"https:\/\/ftp.iitm.ac.in\/cran\/\">https:\/\/ftp.iitm.ac.in\/cran\/<\/a><\/p>\n<p><a href=\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2018\/02\/2-5.jpg\" rel=\"attachment wp-att-2009\"><img loading=\"lazy\" src=\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2018\/02\/2-5.jpg\" alt=\"2\" width=\"602\" height=\"118\" class=\"aligncenter size-full wp-image-2009\" srcset=\"https:\/\/www.stepbystepschools.net\/wp-content\/uploads\/2018\/02\/2-5.jpg 602w, https:\/\/www.stepbystepschools.net\/wp-content\/uploads\/2018\/02\/2-5-300x59.jpg 300w\" sizes=\"(max-width: 602px) 100vw, 602px\" \/><\/a><\/p>\n<p>And Type and Run the following code RGui<\/p>\n<p><font size=\"5\"><span style=\"background-color: #D3D3A9\">install.packages<\/span><span style=\"background-color: #D3D3A9\">(&#8220;ggplot2&#8221;)<\/span><\/font><\/p>\n<p><b>For Linux Users:<\/b><\/p>\n<p>If you are on Linux platform then you can use this fast and easy command used in Linux which can be used to install R. The yum command is used for installing like this:<\/p>\n<p>$ yum install R<\/p>\n<p>For Ubuntu Linux or other Debian-related OSs, a more direct method is:<\/p>\n<p>$ apt-get install r-base<\/p>\n<p>Now Let\u2019s Start using the RGui (64 -bit) which will be installed in the Installation folder which we had selected while installing the software.<\/p>\n<p>Code for Plotting a Time Series for a Salary Growth is as Follows:<\/p>\n<p>Comments are presented with a # at the start<\/p>\n<p><span style=\"background-color: #FFFF00\"># timeseries.object.name <-  ts(data, start, end, frequency)<br \/>\n #  data is a vector or matrix containing the values used in the time series.<br \/>\n #    start specifies the start time for the first observation in time series.<br \/>\n#     end specifies the end time for the last observation in time series.<br \/>\n  #   frequency specifies the number of observations per unit time.<\/span>\n<\/p>\n<p><span style=\"background-color: #FFFF00\"># Get the data points in form of a R vector.<\/span><\/p>\n<p><span style=\"background-color: #C0C0C0\">Salary <-<br \/> <br \/>\nc(3000,4000,4500,5500,6000,6500,7000,7500,8000,8500,9000,9500,10000)<\/span><\/p>\n<p><span style=\"background-color: #FFFF00\"># Convert it to a time series object.<\/span><br \/>\n<span style=\"background-color: #C0C0C0\">Salary.timeseries <- ts(Salary,start = c(2000),frequency = 2)\n<\/span>\n<\/p>\n<p><span style=\"background-color: #FFFF00\"># Print the timeseries data.<\/span><br \/>\n<span style=\"background-color: #C0C0C0\">print(Salary.timeseries)<br \/>\n<\/span>\n<\/p>\n<p><span style=\"background-color: #FFFF00\"># Plot a graph of the time series.<\/span><br \/>\n<span style=\"background-color: #C0C0C0\">plot(Salary.timeseries)<\/span>\n<\/p>\n<p><span style=\"background-color: #FFFF00\"># Give the chart file a name.<\/span><br \/>\n<span style=\"background-color: #C0C0C0\">png(file = &#8220;Salary.png&#8221;)<\/span><br \/>\n<span style=\"background-color: #FFFF00\"># Save the file.<\/span><br \/>\n<span style=\"background-color: #C0C0C0\">dev.off()<\/span>\n<\/p>\n<p>Output for the above Code:<\/p>\n<p><a href=\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2018\/02\/3-5.jpg\" rel=\"attachment wp-att-2010\"><img loading=\"lazy\" src=\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2018\/02\/3-5.jpg\" alt=\"3\" width=\"544\" height=\"539\" class=\"aligncenter size-full wp-image-2010\" srcset=\"https:\/\/www.stepbystepschools.net\/wp-content\/uploads\/2018\/02\/3-5.jpg 544w, https:\/\/www.stepbystepschools.net\/wp-content\/uploads\/2018\/02\/3-5-150x150.jpg 150w, https:\/\/www.stepbystepschools.net\/wp-content\/uploads\/2018\/02\/3-5-300x297.jpg 300w\" sizes=\"(max-width: 544px) 100vw, 544px\" \/><\/a><\/p>\n<p><a target=\"_blank\" href=\"http:\/\/stepbystepschools.net\/?page_id=1842\">Syllabus of Data Science training in Mumbai<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A time series is a sequence of numerical data points which are represented in successive order. In Investment and Capital, a time series tracks the movement of the chosen data points, such as a security\u2019s price, over a specified period &hellip; <a href=\"https:\/\/www.stepbystepschools.net\/?p=2007\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":40,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[1],"tags":[198,199,203,204],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v18.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Data Science Training in Mumbai :- Simple Time Series Example using R Language. - Learn MVC, Angular, Architecture, MSBI, Data Science in Mumbai<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.stepbystepschools.net\/?p=2007\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Data Science Training in Mumbai :- Simple Time Series Example using R Language. - Learn MVC, Angular, Architecture, MSBI, Data Science in Mumbai\" \/>\n<meta property=\"og:description\" content=\"A time series is a sequence of numerical data points which are represented in successive order. In Investment and Capital, a time series tracks the movement of the chosen data points, such as a security\u2019s price, over a specified period &hellip; Continue reading &rarr;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.stepbystepschools.net\/?p=2007\" \/>\n<meta property=\"og:site_name\" content=\"Learn MVC, Angular, Architecture, MSBI, Data Science in Mumbai\" \/>\n<meta property=\"article:published_time\" content=\"2018-02-21T04:26:31+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2018\/02\/1-5.jpg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"StepByStepSchoolsSupport\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.stepbystepschools.net\/#website\",\"url\":\"https:\/\/www.stepbystepschools.net\/\",\"name\":\"Learn MVC, Angular, Architecture, MSBI, Data Science in Mumbai\",\"description\":\"MVC 5\/Core, AngularJS 1.x, 2.0, 4.0, Design Pattern, Architecture, SSIS, SSAS, SSRS, Data Science, Big data, Hadoop classroom training\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.stepbystepschools.net\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.stepbystepschools.net\/?p=2007#primaryimage\",\"url\":\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2018\/02\/1-5.jpg\",\"contentUrl\":\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2018\/02\/1-5.jpg\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.stepbystepschools.net\/?p=2007#webpage\",\"url\":\"https:\/\/www.stepbystepschools.net\/?p=2007\",\"name\":\"Data Science Training in Mumbai :- Simple Time Series Example using R Language. - Learn MVC, Angular, Architecture, MSBI, Data Science in Mumbai\",\"isPartOf\":{\"@id\":\"https:\/\/www.stepbystepschools.net\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.stepbystepschools.net\/?p=2007#primaryimage\"},\"datePublished\":\"2018-02-21T04:26:31+00:00\",\"dateModified\":\"2018-02-21T04:26:31+00:00\",\"author\":{\"@id\":\"https:\/\/www.stepbystepschools.net\/#\/schema\/person\/7131e4ee1c5673879e6029d14ec2f655\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.stepbystepschools.net\/?p=2007#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.stepbystepschools.net\/?p=2007\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.stepbystepschools.net\/?p=2007#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.stepbystepschools.net\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Data Science Training in Mumbai :- Simple Time Series Example using R Language.\"}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.stepbystepschools.net\/#\/schema\/person\/7131e4ee1c5673879e6029d14ec2f655\",\"name\":\"StepByStepSchoolsSupport\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.stepbystepschools.net\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/cecaf2a0ee369391127b0159c266979d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/cecaf2a0ee369391127b0159c266979d?s=96&d=mm&r=g\",\"caption\":\"StepByStepSchoolsSupport\"},\"url\":\"https:\/\/www.stepbystepschools.net\/?author=40\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Data Science Training in Mumbai :- Simple Time Series Example using R Language. - Learn MVC, Angular, Architecture, MSBI, Data Science in Mumbai","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.stepbystepschools.net\/?p=2007","og_locale":"en_US","og_type":"article","og_title":"Data Science Training in Mumbai :- Simple Time Series Example using R Language. - Learn MVC, Angular, Architecture, MSBI, Data Science in Mumbai","og_description":"A time series is a sequence of numerical data points which are represented in successive order. In Investment and Capital, a time series tracks the movement of the chosen data points, such as a security\u2019s price, over a specified period &hellip; Continue reading &rarr;","og_url":"https:\/\/www.stepbystepschools.net\/?p=2007","og_site_name":"Learn MVC, Angular, Architecture, MSBI, Data Science in Mumbai","article_published_time":"2018-02-21T04:26:31+00:00","og_image":[{"url":"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2018\/02\/1-5.jpg"}],"twitter_card":"summary_large_image","twitter_misc":{"Written by":"StepByStepSchoolsSupport","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/www.stepbystepschools.net\/#website","url":"https:\/\/www.stepbystepschools.net\/","name":"Learn MVC, Angular, Architecture, MSBI, Data Science in Mumbai","description":"MVC 5\/Core, AngularJS 1.x, 2.0, 4.0, Design Pattern, Architecture, SSIS, SSAS, SSRS, Data Science, Big data, Hadoop classroom training","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.stepbystepschools.net\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.stepbystepschools.net\/?p=2007#primaryimage","url":"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2018\/02\/1-5.jpg","contentUrl":"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2018\/02\/1-5.jpg"},{"@type":"WebPage","@id":"https:\/\/www.stepbystepschools.net\/?p=2007#webpage","url":"https:\/\/www.stepbystepschools.net\/?p=2007","name":"Data Science Training in Mumbai :- Simple Time Series Example using R Language. - Learn MVC, Angular, Architecture, MSBI, Data Science in Mumbai","isPartOf":{"@id":"https:\/\/www.stepbystepschools.net\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.stepbystepschools.net\/?p=2007#primaryimage"},"datePublished":"2018-02-21T04:26:31+00:00","dateModified":"2018-02-21T04:26:31+00:00","author":{"@id":"https:\/\/www.stepbystepschools.net\/#\/schema\/person\/7131e4ee1c5673879e6029d14ec2f655"},"breadcrumb":{"@id":"https:\/\/www.stepbystepschools.net\/?p=2007#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.stepbystepschools.net\/?p=2007"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.stepbystepschools.net\/?p=2007#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.stepbystepschools.net\/"},{"@type":"ListItem","position":2,"name":"Data Science Training in Mumbai :- Simple Time Series Example using R Language."}]},{"@type":"Person","@id":"https:\/\/www.stepbystepschools.net\/#\/schema\/person\/7131e4ee1c5673879e6029d14ec2f655","name":"StepByStepSchoolsSupport","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.stepbystepschools.net\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/cecaf2a0ee369391127b0159c266979d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cecaf2a0ee369391127b0159c266979d?s=96&d=mm&r=g","caption":"StepByStepSchoolsSupport"},"url":"https:\/\/www.stepbystepschools.net\/?author=40"}]}},"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"_links":{"self":[{"href":"https:\/\/www.stepbystepschools.net\/index.php?rest_route=\/wp\/v2\/posts\/2007"}],"collection":[{"href":"https:\/\/www.stepbystepschools.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.stepbystepschools.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.stepbystepschools.net\/index.php?rest_route=\/wp\/v2\/users\/40"}],"replies":[{"embeddable":true,"href":"https:\/\/www.stepbystepschools.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2007"}],"version-history":[{"count":2,"href":"https:\/\/www.stepbystepschools.net\/index.php?rest_route=\/wp\/v2\/posts\/2007\/revisions"}],"predecessor-version":[{"id":2012,"href":"https:\/\/www.stepbystepschools.net\/index.php?rest_route=\/wp\/v2\/posts\/2007\/revisions\/2012"}],"wp:attachment":[{"href":"https:\/\/www.stepbystepschools.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2007"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.stepbystepschools.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2007"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.stepbystepschools.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2007"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}