Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion R/reduce_rank_regression.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
reduce_rank_regression <- function(x, y, gamma_matrix, rank = "full", k = 0){
full_rank <- min(dim(x)[2], dim(y)[2])
full_rank <- dim(y)[2]
if(rank == "full"){
reduce_rank <- full_rank
} else if(rank <= full_rank){
Expand Down
6 changes: 3 additions & 3 deletions R/rrr.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ rrr <- function(x, y, type = "identity", rank = "full", k = 0){
if(type == "lda"){
full_rank <- dim(distinct(as_data_frame(y)))[1] - 1
} else {
full_rank <- min(dim(x)[2], dim(y)[2])
full_rank <- dim(y)[2]
}
if(rank == "full"){
reduced_rank <- full_rank
Expand Down Expand Up @@ -99,7 +99,7 @@ rrr <- function(x, y, type = "identity", rank = "full", k = 0){
#' @export

rank_trace <- function(x, y, type = "identity", k = 0, plot = TRUE, interactive = FALSE){
ident <- diag(1, min(dim(x)[2], dim(y)[2]))
ident <- diag(1, dim(y)[2])
switch(type,
identity = rrr_rank_trace(x, y, ident, k, plot, interactive),
cva = cva_rank_trace(x, y, k, plot, interactive),
Expand Down Expand Up @@ -138,7 +138,7 @@ rank_trace <- function(x, y, type = "identity", k = 0, plot = TRUE, interactive
#' @export

residuals <- function(x, y, type = "identity", rank = "full", k = 0, plot = TRUE){
ident <- diag(1, min(dim(x)[2], dim(y)[2]))
ident <- diag(1, dim(y)[2])
switch(type,
identity = rrr_residual_plot(x, y, ident, rank, k, plot),
cva = cva_residual_plot(x, y, rank, k, plot),
Expand Down