Displaying 2 results from an estimated 2 matches for "gasdays".
Did you mean:
assays
2011 Jun 15
3
Column of numbers added to dataframe when saving with read.csv
I have a dataframe object having the following structure
FinalOutput[1:3,]
GasDays 2011-03-31 2010-09-30 2010-10-31 2010-11-30 2010-12-31
2011-01-31 2011-02-28
1 2006-10-01 217303553 221205033 222824639 217016511 216093460
216477468 216834021
2 2006-10-02 231158527 234565250 236004109 231467851 230100639
230079907 230734064
3 2006-10-03 282062314 285427832 28637216...
2011 Jul 06
1
Group Data indexed by n Variables
...ompute the
average of my data based on the value of the month and day across years. I
have come up withy the code below which, as far as I can see, does what I
need but getting either a more elegant or a more versatile way to do this
would be nice.
Thanks
Paolo.
Days = format(as.Date(Data[["GasDays"]], format = "%d/%m/%Y"), "%d")
Months = format(as.Date(Data[["GasDays"]], format = "%d/%m/%Y"), "%m")
MonthDayCombs = paste(Months, Days)
AvgDemand = data.matrix(by(Data$RescaledDemand, DayMonthCombs, mean))
On 4 July 2011 10:34, EdBo <...