[R-br] Ajuda com NA

Rodrigo Coster rcoster em gmail.com
Quarta Novembro 28 16:56:17 BRST 2012


supondo que esteja na variável bla:
na.exclude(bla$afia3)



2012/11/28 Sérgio Henrique almeida da silva ju <sergio.edfisica em gmail.com>

> structure(list(afia3 = c(0, 1, 0, 3, 0, 0, 0, 0, 0, 0, 0, 5,
> 0, 0, 0, 0, 2, 4, 0, 3, 0, 3, 0, 0, 0, 3, 2, 0, 0, 0, 0, 0, 0,
> 0, 0, 0, 0, 0, 0, 5, 0, 1, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0,
> 0, 1, 2, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, NA, 0, 0, 0, 0,
> 2, 2, 0, 3, 0, 0, 0, 0, 5, 0, 3, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0,
> 0, 0, 0, 0, 4, 5, 0, 1, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 4, 4, 0,
> 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 3, 0,
> 3, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0,
> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0,
> 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0,
> 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
> 0, 0, 0, 0, 2, 0, 0, 0, 0, 2, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0,
> 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 2, 0, 3, 0, 0, 0, 0, 0, 0, 0,
> 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 3, 2, 5, 0, 0, 0, 0, 0, 0, 0,
> 0, 0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0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 1, 0, 0, 0, 0, 0, 2, 0, 0,
> 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 5, 0, 0,
> 3, 0, 0, 4, 0, 0, 2, 3, 0, 0, 0, 0, 2, 0, 0, 0, 6, 0, 0, 0, 0,
> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4,
> 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 2, 0, 0, 0, 0, 3, 0, 0,
> 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 5,
> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 4, 0, 0)
>
> Em 28 de novembro de 2012 16:51, Rodrigo Coster <rcoster em gmail.com>escreveu:
>
> manda um dput() completo dos dados (ou eles são só isso?)
>>
>>
>> 2012/11/28 Sérgio Henrique almeida da silva ju <sergio.edfisica em gmail.com
>> >
>>
>>> Eu tentei isso também
>>>
>>> Mas os malditos permanecem! rs
>>>
>>> Em 28 de novembro de 2012 16:47, Daniel C Bezerra <
>>> danielcbezerra em gmail.com> escreveu:
>>>
>>> na.exclude(nomedobanco)
>>>>
>>>> Apenas MUITO cuidado, pois se vc aplicar este comando a um data frame
>>>> TODAS AS LINHAS que contém NA serão excluídas, inclusive aquelas em que os
>>>> vetores estejam completos. O ideal é tentar conviver com os NAs,  lembrando
>>>> de adicionar os argumentos apropriados a vetores onde ele estejam
>>>> presentes.
>>>>
>>>> Exemplo:
>>>> mean(nomedovetor,na.omit=T)
>>>>
>>>> Ao rodar uma regressão os NAs são automaticamente ignorados.
>>>>
>>>> Abs,
>>>>
>>>> D
>>>>
>>>> 2012/11/28 Sérgio Henrique almeida da silva ju <
>>>> sergio.edfisica em gmail.com>
>>>>
>>>>> Olá
>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, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 0, 3, 5,
>>>>> 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 1, 0, 0, 0, 0, 0, 2, 0, 0,
>>>>> 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 5, 0, 0,
>>>>> 3, 0, 0, 4, 0, 0, 2, 3, 0, 0, 0, 0, 2, 0, 0, 0, 6, 0, 0, 0, 0,
>>>>> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4,
>>>>> 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 2, 0, 0, 0, 0, 3, 0, 0,
>>>>> 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 5,
>>>>> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 4, 0, 0)
>>>>>
>>>>> Como posso fazer isso?
>>>>>
>>>>> Abraços
>>>>>
>>>>> --
>>>>> Sérgio Henrique Almeida da Silva Junior
>>>>> Doutorando em Epidemiologia em Saúde Pública
>>>>> Escola Nacional de Saúde Pública Sérgio Arouca - ENSP/FIOCRUZ
>>>>> http://lattes.cnpq.br/1611345552843383
>>>>> Tel: (21) 94429486/78101651 id: 123*20942
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> 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.
>>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> 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.
>>>>
>>>
>>>
>>>
>>> --
>>> Sérgio Henrique Almeida da Silva Junior
>>> Doutorando em Epidemiologia em Saúde Pública
>>> Escola Nacional de Saúde Pública Sérgio Arouca - ENSP/FIOCRUZ
>>> http://lattes.cnpq.br/1611345552843383
>>> Tel: (21) 94429486/78101651 id: 123*20942
>>>
>>>
>>>
>>> _______________________________________________
>>> 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.
>>>
>>
>>
>> _______________________________________________
>> 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.
>>
>
>
>
> --
> Sérgio Henrique Almeida da Silva Junior
> Doutorando em Epidemiologia em Saúde Pública
> Escola Nacional de Saúde Pública Sérgio Arouca - ENSP/FIOCRUZ
> http://lattes.cnpq.br/1611345552843383
> Tel: (21) 94429486/78101651 id: 123*20942
>
>
>
> _______________________________________________
> 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/20121128/ed1937ed/attachment.html>


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