Skip to content

Commit 1198a02

Browse files
authored
Update smooth.monotone.R
1 parent 2c789bb commit 1198a02

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

R/smooth.monotone.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,13 @@ nbasis <- basisobj$nbasis # number of basis functions
128128
# set up initial coefficient array
129129

130130
coef0 <- Wfdobj$coefs
131-
if(length(dim(coef0)) == 2 & nvar != 1){
131+
if( length(dim(coef0)) == 2 & nvar != 1 ){
132132
coef0 = array(0,c(nbasis,ncurve,nvar))
133133
}
134-
if( dim(coef0) == 2 & ncol(coef0) != ncurve){
134+
if( length(dim(coef0)) == 2 & ncol(coef0) != ncurve ){
135135
coef0 = matrix(0,nbasis,ncurve)
136136
}
137-
if( dim(coef0) == 3 & (all.equal(dim(coef0)[2:3],c(ncurve,nvar))!=TRUE) ){
137+
if( length(dim(coef0)) == 3 & (all.equal(dim(coef0)[2:3],c(ncurve,nvar))!=TRUE) ){
138138
coef0 = array(0,c(nbasis,ncurve,nvar))
139139
}
140140
# Note that we could be more carefull about this and try to adapt coefficients

0 commit comments

Comments
 (0)