Skip to content

Commit 7e33622

Browse files
author
Giles Hooker
committed
updates to smooth.basis.sparse.R
1 parent f4286ba commit 7e33622

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: R/smooth.basis.sparse.R

+3-3
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,16 @@ smooth.basis.sparse <- function(argvals, y, fdParobj, fdnames=NULL, covariates=N
7676
coefs = matrix(0, nrow = basisobj$nbasis, ncol = dim(y)[2])
7777
for(i in 1:dim(y)[2]){
7878
curve = y[,i]
79-
curve.smooth = smooth.basis(time[!is.na(curve)],curve[!is.na(curve)],
79+
curve.smooth = smooth.basis(argvals[!is.na(curve)],curve[!is.na(curve)],
8080
basisobj, covariates, method)
8181
coefs[,i] = curve.smooth$fd$coefs
8282
}
83-
} else if(length(dim(y) == 3){
83+
} else if(length(dim(y)) == 3){
8484
coefs = array(0, c(basisobj$nbasis,dim(y)[2:3]))
8585
for(i in 1:dim(y)[2]){
8686
for(j in 1:dim(y)[3]){
8787
curve = y[,i,j]
88-
curve.smooth = smooth.basis(time[!is.na(curve)],curve[!is.na(curve)],
88+
curve.smooth = smooth.basis(argvals[!is.na(curve)],curve[!is.na(curve)],
8989
basisobj, covariates, method)
9090
coefs[,i,j] = curve.smooth$fd$coefs
9191
}

0 commit comments

Comments
 (0)