Displaying 2 results from an estimated 2 matches for "tstodate".
Did you mean:
tstate
2009 Aug 28
2
new data.frame summed by date
...wonder if someone can suggest how to create a new data.frame Y
from X where X$PL_Pos is summed by each unique X$MyDate. Y should end
up with two (or more) columns Y$MyDate and Y$PL_Sum with its value
being the cumsum of all the values in X for that date. - a 'daily
cumsum'.
Thanks,
Mark
TStoDate = function (TSDate) {
X = strptime(TSDate + 19e6L, "%Y%m%d")
return(as.Date(X))
}
X = structure(list(EnDate = c(1090803,
1090804, 1090805, 1090806, 1090806, 1090810, 1090811, 1090812,
1090813, 1090817, 1090819, 1090820, 1090820, 1090824, 1090825,
1090825, 1090826, 1090826, 1090827, 109...
2011 Feb 09
1
Iterate over a list of input files?
...le
file if I specify the file name explicitly in the code. What I need to
do is run it on all the files in the directory tested and augment the
data frame I'm building to have more results columns.How can I do
that?
Here's the code:
library(chron) # .Holidays / is.holiday / is.weekend
TStoDate = function (TSDate) {
X = strptime(TSDate + 19e6L, "%Y%m%d")
return(as.Date(X))
}
FirstDate = 1090601
LastDate = 1101101
StartDate = TStoDate(FirstDate)
EndDate = TStoDate(LastDate)
# Create a sequence of days from start to finish
# Then remove weekends and holidays and turn into a...