1

I am very new to r programming. I have large time series data for more than 5years. It is temperature data collected at an interval of 10 minutes. I need winter data only and I separated winter data using "lubridate". Now I need to compare data for each interval of each single day.

I have data for date, time and temperature and compare result is the result what I want:

Date         time  temperature(F)    Compare result
2011/01/16  14.00    32                 -
2011/01/16  14:10    35                 1
2011/01/16  14:20    29                 1
2011/01/16  14:30    30                 1

Now, I got the "compare result" by specifying range between two consecutive data as 5%. For second value (35) it will be true(equals to 1) if (0.95* 32 <35< 1.05< 32) otherwise false(equals to 0) and so on.
In one loop comparison will be within one day and similarly other loop need to be executed for other day. And one day consists of total 144 data. How can I run this loop to compare data?

Summer
  • 11
  • 2
  • Can you show us your expected output ? – Pankaj Kaundal Jul 12 '16 at 05:59
  • @Summer, please avoid posting info in comments. Edit your question with any further info including reproducible example and expected output. – Sotos Jul 12 '16 at 06:22
  • Please [have a look at this link](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) and revise properly. – Sotos Jul 12 '16 at 06:39

0 Answers0