Displaying 3 results from an estimated 3 matches for "noofdays".
2011 Jan 12
1
snowfall
...trading days
myFinCenter="Asia/Singapore"
getTimeToMaturity <- function(x){
tryCatch({
toDt <- as.Date(as.character(x['EXPIRY_DT']), "%Y-%m-%d")
#Expiry Date
fromDt <- as.Date(as.character(x['TIMESTAMP']), "%Y-%m-%d")
#Trade Timestamp
NoOfDays <- NROW(getTradingDates(toDt,fromDt))
return(NoOfDays/252)
},
error = function (ex){
#print (paste("Error in",toDt,fromDt))
NoOfDays <- 0
return(NoOfDays/252)
}
)
}
Question: The following two lines work but the third and parallel one
doesn't ... why?
1) > appl...
2010 Apr 12
1
N'th of month working day problem
Dear Gabor,
Thanks for your reply. however:
> tail(DJd)
^DJI.Close
2010-04-01 10927.07
2010-04-05 10973.55
2010-04-06 10969.99
2010-04-07 10897.52
2010-04-08 10927.07
*2010-04-09 10997.35*
> tail(ag)
2009-11-30 10344.84
2009-12-31 10428.05
2010-01-31 10067.33
2010-02-28 10325.26
2010-03-31 10856.63
*2010-04-30 10997.35
*
It seems the script "makes up"
2011 May 10
1
Reading a large netCDF file using R
...I tried to get the variable values using this command
> xx=get.var.ncdf(nc)
Error: cannot allocate vector of size 2.1 Gb
This file has six hourly data for the 199 x 99 points for 10 years. I wanted
to aggregate this data into a monthly scale. I tried used a simple code like
this
for (i in 1:noofdays) {
for (j in 0:3) {
x= get.var.ncdf(nc,v1,start=c(1,1,(i+j)),count=c(199,99,1))
temp_data_mat=temp_data_mat+x
}
for (x1 in 1:199) {
for (x2 in 1:99) {
data_mat_89_99[x1,x2,ctr]=temp_data_mat[x1,x2]
}
}
ctr=ctr+1
temp_data_mat=matrix(0,ncol=99,nrow=199)
}
I didnt think it worked....