Error in `contrib.url(repos, "source")`: trying to use CRAN without setting a mirror

if(sum(as.numeric(!pacotes %in% installed.packages())) != 0){
instalador <- pacotes[!pacotes %in% installed.packages()]
# df <- read.xlsx("Modelo_entrada_dados.xlsx", sheet = "Exemplo_1")
# weights_decisor <- as.numeric(df[2, 2:ncol(df)])
# criteria_direction <- df[1, 2:ncol(df)]
# matrix_decis <- as.data.frame(df[3:nrow(df), 2:ncol(df)])
# matrix_decis <- matrix_decis %>% mutate_all(as.numeric)
matrix_decis <- matrix_decis %>% mutate_all(as.numeric)
matrix_decis_norm <- matrix_decis # Inicializar matrix_decis_norm
matrix_decis_norm[,i] <- matrix_decis[,i] / max(matrix_decis[,i])
matrix_decis_norm[,i] <- min(matrix_decis[,i]) / matrix_decis[,i]
pv[j] <- pv[j] + ((matrix_decis_norm[i,j]) -
weights_PSI <- round(desv_pref / sum(desv_pref), 20)
return(weights_PSI) # End of PSI weights calculation ************************
ind_pref[i] <- ind_pref[i] + matrix_decis_norm[i,j] * weights_PSI[j]
select(Alternatives, everything()) %>% arrange(desc(PSI)) %>%

# End of PSI weights calculation ************************

#' @description Receives a standardized dataset and returns the ranking of the
#' alternatives according to the user-defined criteria weight calculation method
#' @param weight_method Method for calculating weights or user-defined weights
#' @param ranking_method Method for ranking the alternatives
#' @param alpha Parameter alpha for the CoCoSo method (optional, used only for
#' @return A dataframe containing the ranked alternatives and the ranking
#' metrics according to the chosen method.
#' # result <- pmtcR(df,ranking_method = "cocoso")
pmtcR <- function(df, weight_method = "decisor", ranking_method, alpha = 0.5) {
if (weight_method == "decisor" & abs(sum(weights_decisor) - 1) > 1E-10) {
stop("The sum of the weights must be equal to 1!")
stop("All values in the Decision Matrix must be numeric!")
if (any(!criteria_direction %in% c("MAX", "MIN"))) {
stop("All criteria must be either MAXIMIZATION or MINIMIZATION!")
if (!weight_method %in% c("psi", "mpsi", "topsis", "decisor")) {
stop("Choose a valid elicitation method for the weights!")
if (!ranking_method %in% c("psi", "topsis", "cocoso")) {
ranked_alternatives <- rank_cocoso(df, vector_weights, alpha)
# ranking <- pmtcR(df4,ranking_method = "cocoso")