Skip to content

Commit 6c78851

Browse files
committed
Committing so my changes aren't overwritten
1 parent 322e7f0 commit 6c78851

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

selectiveInference/R/funs.fs.R

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,10 @@ coef.fs <- function(object, s, ...) {
234234
predict.fs <- function(object, newx, s, ...) {
235235
beta = coef.fs(object,s)
236236
if (missing(newx)) newx = scale(object$x,FALSE,1/object$sx)
237-
else newx = scale(newx,object$bx,FALSE)
237+
else {
238+
newx = matrix(newx,ncol=ncol(object$x))
239+
newx = scale(newx,object$bx,FALSE)
240+
}
238241
return(newx %*% beta + object$by)
239242
}
240243

selectiveInference/R/funs.lar.R

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,10 @@ coef.lar <- function(object, s, mode=c("step","lambda"), ...) {
339339
predict.lar <- function(object, newx, s, mode=c("step","lambda"), ...) {
340340
beta = coef.lar(object,s,mode)
341341
if (missing(newx)) newx = scale(object$x,FALSE,1/object$sx)
342-
else newx = scale(newx,object$bx,FALSE)
342+
else {
343+
newx = matrix(newx,ncol=ncol(object$x))
344+
newx = scale(newx,object$bx,FALSE)
345+
}
343346
return(newx %*% beta + object$by)
344347
}
345348

0 commit comments

Comments
 (0)