[R-br] Dúvida básica

Rodrigo Pereira doforodrigo em gmail.com
Terça Maio 17 14:08:28 BRT 2011


Olá, Paulo.

Tentei fazer isso algumas vezes e aparece uma mensagem dizendo o seguinte:

testeR<-unstack(dados,resposta~(factor(fator1))+(factor(fator2)))

Aviso em Ops.factor((factor(fator1)), (factor(fator2))) :
  + not meaningful for factors

Já tentei modificar algumas coisas, mas ainda não consegui contornar este
problema. Você poderia me ajudar?

Obrigado!

Rodrigo Pereira
(31)9326 3139


2011/5/17 Paulo Justiniano <paulojus em leg.ufpr.br>

> A solucao do Henrique usa uma formula, portanto voce pode acrescentar
> termos como em
>
> unstack(x, resposta ~ fator1 + fator2)
>
> que o agrupamento/ordenacao se dará para as combinacoes dos valores dos
> fatores indicados na formula
>
>
> On Tue, 17 May 2011, Rodrigo Pereira wrote:
>
>  Olá, Henrique. Bom dia.
>> Você sabe como posso trabalhar com o unstack() quando tiver dois ou mais
>> fatores?
>>
>> Obrigado!
>>
>> Rodrigo Pereira
>> (31)9326 3139
>>
>>
>> 2011/5/16 Henrique Dallazuanna <wwwhsd em gmail.com>
>>      Tente assim:
>>
>> unstack(x, resposta ~ fator)
>>
>>
>>      2011/5/16 Rodrigo Pereira <doforodrigo em gmail.com>
>> Caros colegas,
>> Estou com um problema básico, mas que não estou conseguindo resolver
>> (falta de prática com o R...)
>>
>> Estou com o seguinte banco de dados:
>>
>>                    resposta            fator           sujeito
>> 1                   0.00                   R               1
>> 2                   2.96                   R               1
>> 3                  10.28                   R               1
>> 4                  12.42                   R               1
>> 5                  15.60                   R               1
>> 6                  14.23                   R               1
>> 7                  10.55                   R               1
>> 8                   8.00                   R               1
>> 9                   6.12                   R               1
>> 10                  3.24                   R               1
>> 11                  2.82                   R               1
>> 12                  1.18                   R               1
>> 13                  0.42                   R               1
>> 14                  0.00                   R               1
>> 15                  0.00                   R               1
>> 16                  0.00                   T               2
>> 17                  4.01                   T               2
>> 18                 19.82                   T               2
>> 19                 17.83                   T               2
>> 20                 12.74                   T               2
>> 21                  7.37                   T               2
>> 22                  7.73                   T               2
>> 23                  4.70                   T               2
>> 24                  4.11                   T               2
>> 25                  3.11                   T               2
>> 26                  3.19                   T               2
>> 27                  2.25                   T               2
>> 28                  0.44                   T               2
>> 29                  0.16                   T               2
>> 30                  0.00                   T               2
>>
>> Estou tentando utilizar a função unstack() para transformar este banco de
>> dados longo em largo da seguinte forma:
>>
>> R
>>
>> 0
>>
>>
>> T
>>
>> 0
>>
>> 2,96
>>
>> 4,01
>>
>> 10,28
>>
>> 19,82
>>
>> 12,42
>>
>> 17,83
>>
>> 15,6
>>
>> 12,74
>>
>> 14,23
>>
>> 7,37
>>
>> 10,55
>>
>> 7,73
>>
>> 8
>>
>> 4,7
>>
>> 6,12
>>
>> 4,11
>>
>> 3,24
>>
>> 3,11
>>
>> 2,82
>>
>> 3,19
>>
>> 1,18
>>
>> 2,25
>>
>> 0,42
>>
>> 0,44
>>
>> 0
>>
>> 0,16
>>
>> 0
>>
>> 0
>>
>>
>> Alguém sabe como consigo fazer essa mudança com ou sem a função unstack()?
>>
>> Obrigado e abraço!
>>
>> Rodrigo Pereira
>> (31)9326 3139
>>
>> _______________________________________________
>> R-br mailing list
>> R-br em listas.c3sl.ufpr.br
>> https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br
>>
>>
>>
>>
>> --
>> Henrique Dallazuanna
>> Curitiba-Paraná-Brasil
>> 25° 25' 40" S 49° 16' 22" O
>>
>> _______________________________________________
>> R-br mailing list
>> R-br em listas.c3sl.ufpr.br
>> https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br
>>
>>
>>
>>
> _______________________________________________
> R-br mailing list
> R-br em listas.c3sl.ufpr.br
> https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br
>
>
-------------- Próxima Parte ----------
Um anexo em HTML foi limpo...
URL: <http://listas.inf.ufpr.br/pipermail/r-br/attachments/20110517/000c1d0c/attachment.html>


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