Hi All, I have data based on truck load for various states. The data points range from Oct'14 To Mar'15. Now I need to know what was the difference in load in Nov as compared to Oct in both real numbers as well as in %. Similarly for all the month in comparison to the previous month. I am able to get the desired result in excel and not sure on how to achieve the same in R. Kindly suggest. -- View this message in context: http://r.789695.n4.nabble.com/MOnth-over-Month-Variance-in-tp4706873.html Sent from the R help mailing list archive at Nabble.com.
It seems like the ?diff function might be useful here, but without a reproducible example (at the very least some data provided as dput output and results of your Excel calculations for that data) we would have to guess quite a bit and likely be wrong. Take the recommendations at [1] to heart and give us a better picture of your problem and attempted solution. [1] http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example --------------------------------------------------------------------------- Jeff Newmiller The ..... ..... Go Live... DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/Batteries O.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --------------------------------------------------------------------------- Sent from my phone. Please excuse my brevity. On May 6, 2015 3:21:27 AM PDT, Shivi82 <shivibhatia at ymail.com> wrote:>Hi All, >I have data based on truck load for various states. >The data points range from Oct'14 To Mar'15. Now I need to know what >was the >difference in load in Nov as compared to Oct in both real numbers as >well as >in %. Similarly for all the month in comparison to the previous month. >I am able to get the desired result in excel and not sure on how to >achieve >the same in R. > >Kindly suggest. > > > >-- >View this message in context: >http://r.789695.n4.nabble.com/MOnth-over-Month-Variance-in-tp4706873.html >Sent from the R help mailing list archive at Nabble.com. > >______________________________________________ >R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >https://stat.ethz.ch/mailman/listinfo/r-help >PLEASE do read the posting guide >http://www.R-project.org/posting-guide.html >and provide commented, minimal, self-contained, reproducible code.
I think we need to know a bit about your level of knowledge of R, what the data currently looks like (In R format preferably) and maybe see what you have tried so far. Please have a look at the following link, and pay particular attention to the use of dput() as a way to present data on R-help. John Kane Kingston ON Canada> -----Original Message----- > From: shivibhatia at ymail.com > Sent: Wed, 6 May 2015 03:21:27 -0700 (PDT) > To: r-help at r-project.org > Subject: [R] MOnth over Month Variance in % > > Hi All, > I have data based on truck load for various states. > The data points range from Oct'14 To Mar'15. Now I need to know what was > the > difference in load in Nov as compared to Oct in both real numbers as well > as > in %. Similarly for all the month in comparison to the previous month. > I am able to get the desired result in excel and not sure on how to > achieve > the same in R. > > Kindly suggest. > > > > -- > View this message in context: > http://r.789695.n4.nabble.com/MOnth-over-Month-Variance-in-tp4706873.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.____________________________________________________________ Send your photos by email in seconds... TRY FREE IM TOOLPACK at http://www.imtoolpack.com/default.aspx?rc=if3 Works in all emails, instant messengers, blogs, forums and social networks.
Thanks John for the tip. I will use it and see what is the output. Also I will share my analysis on R & then you can advice accordingly. -- View this message in context: http://r.789695.n4.nabble.com/MOnth-over-Month-Variance-in-tp4706873p4706923.html Sent from the R help mailing list archive at Nabble.com.