[R-br] Erro: pacote não encontrado

Pedro Emmanuel Alvarenga Americano do Brasil emmanuel.brasil em gmail.com
Terça Setembro 27 10:28:41 BRT 2011


Benilton,

COmo eu imaginava, o que voce diz é que provavelmente sou eu que estou
inserindo o erro. Basta saber aonde.

Segue a saida da função... não há especificação do pacote.

 > library('epicalc')>
followup.plot(c$prontuario,c$dias,c$CD,by=c$iris)Erro em
get(search()[2]) : objeto 'package:rms' não encontrado>
followup.plotfunction (id, time, outcome, by = NULL, n.of.lines =
NULL, legend = TRUE,
    legend.site = "topright", lty = "auto", line.col = "auto",
    stress = NULL, stress.labels = FALSE, label.col = 1, stress.col = NULL,
    stress.width = NULL, stress.type = NULL, lwd = 1, xlab, ylab,
    ...)
{
    if (missing(xlab)) {
        xlab <- as.character(substitute(time))
        if (any(class(get(search()[2])) == "data.frame")) {
            if (any(attr(get(search()[2]), "names") ==
as.character(substitute(xlab)))) {
                if (!is.null(attr(get(search()[2]),
"var.labels")[attr(get(search()[2]),
                  "names") == as.character(substitute(xlab))])) {
                  if (attr(get(search()[2]),
"var.labels")[attr(get(search()[2]),
                    "names") == as.character(substitute(xlab))] !=
                    "") {
                    xlab <- attr(get(search()[2]),
"var.labels")[attr(get(search()[2]),
                      "names") == as.character(substitute(xlab))]
                  }
                }
            }
        }
    }
    if (missing(ylab)) {
        ylab <- as.character(substitute(outcome))
        if (any(class(get(search()[2])) == "data.frame")) {
            if (any(attr(get(search()[2]), "names") ==
as.character(substitute(ylab)))) {
                if (!is.null(attr(get(search()[2]),
"var.labels")[attr(get(search()[2]),
                  "names") == as.character(substitute(ylab))])) {
                  if (attr(get(search()[2]),
"var.labels")[attr(get(search()[2]),
                    "names") == as.character(substitute(ylab))] !=
                    "") {
                    ylab <- attr(get(search()[2]),
"var.labels")[attr(get(search()[2]),
                      "names") == as.character(substitute(ylab))]
                  }
                }
            }
        }
    }
    plot(time, outcome, xlab = xlab, ylab = ylab, type = "n",
        lwd = lwd, ...)
    if (any(lty == "auto"))
        lty <- rep(1, length(id))
    id1 <- id
    time1 <- time
    by1 <- by
    outcome1 <- outcome
    if (is.null(n.of.lines)) {
        if (!is.null(by)) {
            id <- id[order(id1, time1, by1)]
            id.factor <- factor(id)
            time <- time[order(id1, time1, by1)]
            outcome <- outcome[order(id1, time1, by1)]
            by <- by[order(id1, time1, by1)]
            by.factor <- factor(by)
            if (any(line.col == "auto")) {
                line.col <- 1:length(levels(by.factor))
            }
            for (i in 1:length(levels(by.factor))) {
                for (j in 1:length(levels(id.factor))) {
                  lines(time[id.factor == levels(id.factor)[j] &
                    by.factor == levels(by.factor)[i]], outcome[id.factor ==
                    levels(id.factor)[j] & by.factor == levels(by.factor)[i]],
                    col = line.col[i], lty = i, lwd = lwd)
                }
            }
            if (legend) {
                legend(x = legend.site, legend = levels(factor(by)),
                  col = line.col, bg = "white", lty =
1:length(levels(factor(by))),
                  lwd = lwd)
            }
        }
        else {
            id <- id[order(id1, time1)]
            id.factor <- factor(id)
            time <- time[order(id1, time1)]
            outcome <- outcome[order(id1, time1)]
            if (length(levels(factor(id))) < 8) {
                if (any(line.col == "auto"))
                  line.col <- 1:length(levels(id.factor))
                for (j in 1:length(levels(id.factor))) {
                  lines(time[id.factor == levels(id.factor)[j]],
                    outcome[id.factor == levels(id.factor)[j]],
                    col = line.col[j], lwd = lwd, lty = lty[j])
                }
                if (legend) {
                  legend(x = legend.site, legend =
levels(factor(id[order(id1)])),
                    col = line.col[1:length(levels(factor(id)))],
                    bg = "white", lty = lty, lwd = lwd)
                }
            }
            else {
                for (j in 1:length(levels(id.factor))) {
                  if (any(line.col == "multicolor")) {
                    lines(time[id.factor == levels(id.factor)[j]],
                      outcome[id.factor == levels(id.factor)[j]],
                      col = j, lwd = lwd)
                  }
                  else {
                    if (any(line.col == "auto"))
                      line.col <- "blue"
                    lines(time[id.factor == levels(id.factor)[j]],
                      outcome[id.factor == levels(id.factor)[j]],
                      col = line.col, lwd = lwd)
                  }
                }
            }
        }
    }
    else {
        order.id.selected <- sample(c(rep(TRUE, n.of.lines),
            rep(FALSE, length(levels(factor(id))) - n.of.lines)))
        if (!is.null(by)) {
            id <- id[order(id1, time1, by1)]
            time <- time[order(id1, time1, by1)]
            outcome <- outcome[order(id1, time1, by1)]
            by <- by[order(id1, time1, by1)]
            id.factor <- factor(id)
            by.factor <- factor(by)
            if (any(line.col == "auto"))
                line.col <- 1:length(levels(by.factor))
            for (i in 1:length(levels(by.factor))) {
                for (j in 1:length(levels(id.factor))) {
                  lines(time[id.factor == levels(id.factor)[j] &
                    by.factor == levels(by.factor)[i]] * order.id.selected[j],
                    outcome[id.factor == levels(id.factor)[j] &
                      by.factor == levels(by.factor)[i]] *
order.id.selected[j],
                    col = line.col[i], lty = i, lwd = lwd)
                }
            }
            if (legend) {
                legend(x = legend.site, legend = levels(factor(by)),
                  col = line.col[1:length(levels(factor(by)))],
                  lty = 1:length(levels(factor(by))), bg = "white",
                  lwd = lwd)
            }
        }
        else {
            id <- id[order(id1, time1)]
            id.factor <- factor(id)
            time <- time[order(id1, time1)]
            outcome <- outcome[order(id1, time1)]
            for (j in 1:length(levels(id.factor))) {
                if (any(line.col == "multicolor")) {
                  lines(time[id.factor == levels(id.factor)[j]] *
                    order.id.selected[j], outcome[id.factor ==
                    levels(id.factor)[j]] * order.id.selected[j],
                    col = j, lwd = lwd)
                }
                else {
                  if (any(line.col == "auto")) {
                    line.col <- "blue"
                  }
                  lines(time[id.factor == levels(id.factor)[j]] *
                    order.id.selected[j], outcome[id.factor ==
                    levels(id.factor)[j]] * order.id.selected[j],
                    col = line.col, lwd = lwd)
                }
            }
        }
    }
    for (j in 1:length(levels(id.factor))) {
        text(time[id.factor == levels(id.factor)[j]], outcome[id.factor ==
            levels(id.factor)[j]], labels = j, col = any(stress.labels *
            stress %in% j) * label.col)
    }
    for (j in 1:length(levels(id.factor))) {
        lines(time[id.factor == levels(id.factor)[j]], outcome[id.factor ==
            levels(id.factor)[j]], col = any(stress %in% j) *
            stress.col, lwd = stress.width, lty = stress.type)
    }
}


,
Abraço forte e que a força esteja com você,

Dr. Pedro Emmanuel A. A. do Brasil
Instituto de Pesquisa Clínica Evandro Chagas
Fundação Oswaldo Cruz
Rio de Janeiro - Brasil
Av. Brasil 4365,
CEP 21040-360,
Tel 55 21 3865-9648
email: pedro.brasil em ipec.fiocruz.br
email: emmanuel.brasil em gmail.com

---Apoio aos softwares livres
www.zotero.org - gerenciamento de referências bibliográficas.
www.broffice.org ou www.libreoffice.org - textos, planilhas ou
apresentações.
www.epidata.dk - entrada de dados.
www.r-project.org - análise de dados.
www.ubuntu.com - sistema operacional


Em 27 de setembro de 2011 10:17, Benilton Carvalho <
beniltoncarvalho em gmail.com> escreveu:

> R --vanilla
>
> iniciara' o R ignorando qq configuracao personalizada (.Rprofile) ou
> arquivos de inicializacao (.RData).
>
> Dificil dizer, sem ver os dados e sua estrutura, o que pode estar
> acontecendo.
>
> Uma sugestao (pouco provavel de ser associada a esse problema) e' usar
> outro nome para o conjunto de dados... Usar 'c' eh ligeiramente
> arriscado, ja' que existe um comando com o mesmo nome (eu sei, o R vai
> tentar diferenciar um do outro, mas nessas horas vc quer minimizar as
> possibilidades de problema).
>
> Um chute: vc tem algum objecto ou outro comando chamado followup??? Se
> sim, e' bem provavel ser um clash em S3 causado por desenvolvedores
> que insistem em nao usar NAMESPACE e/ou o autor do epicalc q escolheu
> um nome muito ruim pra funcao (a gente sempre pede: "nao crie funcoes
> com um ponto no nome"... e existe uma razao para isso).... Digite
> 'followup' e veja o q acontece (ideal seria retornar um erro dizendo q
> o obj nao foi encontrado). Se retornar o corpo de uma funcao, ele
> dira' no final que pacote esta' definindo essa funcao... dai' use:
>
> detach("package:nome_do_pacote")
>
> e tente de novo.
>
>
> b
> _______________________________________________
> R-br mailing list
> R-br em listas.c3sl.ufpr.br
> https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br
> Leia o guia de postagem (http://www.leg.ufpr.br/r-br-guia) e forneça
> código mínimo reproduzível.
>
-------------- Próxima Parte ----------
Um anexo em HTML foi limpo...
URL: <http://listas.inf.ufpr.br/pipermail/r-br/attachments/20110927/01245a6e/attachment.html>


Mais detalhes sobre a lista de discussão R-br