Displaying 2 results from an estimated 2 matches for "lastfriday".
2004 Mar 02
2
Stuck in trying to convert repetitive code into a function
Folks,
I have the following repetitive code which works correctly:
A = read.table(file="junior.csv", sep=",", col.names=c("date", "l"));
A$date = chron(as.character(A$date), format="m/d/y");
r.junior = levels2weeklyret(lastfriday, A$date, A$l);
plot(A$date, A$l, type="l", col="red", main="Junior levels")
z <- locator(1)
A = read.table(file="kospi.csv", sep=",", col.names=c("date", "l"));
A$date = chron(as.character(A$date), format="m/...
2004 Mar 29
9
Aggregating frequency of irregular time series
...urrency) into a vector of weekly returns.
### How We focus on friday-to-friday returns. If a friday was
### not traded, we take the most-recent available price.
### We compute 100*log(p2/p1) where p1 and p2 are the prices
### as of 2 consecutive fridays.
### Inputs lastfriday A chron object showing the last friday which
### is NOT in the dataset.
### dates A vector of dates (chron objects)
### levels A vector of prices.
### Daily levels data is the list of points (dates[i], levels[i])
### CAREFUL This fu...