Using the ddmatrix apply function offered in pbdDMAT, I am running into difficulty passing an additional parameter to the function used in apply. In the case below, "dat" is a local matrix and "distributed.dat" is it's distributed version. Variable "t" offers temporal information and is, in this case, not distributed, as it corresponds to each row of dat/distributed.dat.
It appears that the additional variable "t" is not being passed along with the variable to be operated on when in distributed mode. A code snippet is below. Any help would be appreciated!
> clim.mat <- apply(X=dat,MARGIN=1,FUN=calc.tsday.clim,t=t,nharm=nharm)
> clim.mat <- apply(X=distributed.dat,MARGIN=1,FUN=calc.tsday.clim,t=t,nharm=nharm)
Hide Traceback
Rerun with Debug
Error in which(t$day == clim$t$day[i] & t$month == clim$t$month[i]) :
argument "t" is missing, with no default
7 which(t$day == clim$t$day[i] & t$month == clim$t$month[i])
6 FUN(newX[, i], ...)
5 apply(X@Data, MARGIN = 1, FUN = FUN)
4 apply(X@Data, MARGIN = 1, FUN = FUN)
3 .local(X, MARGIN, FUN, ...)
2 apply(X = distributed.dat, MARGIN = 1, FUN = calc.tsday.clim,
t = t, nharm = nharm)
1 apply(X = distributed.dat, MARGIN = 1, FUN = calc.tsday.clim,
t = t, nharm = nharm)