[R-br] data.frame para planilha de dados
Nicolay Cunha
nicolaycunha em gmail.com
Sexta Janeiro 11 11:55:14 BRST 2013
Valeu Daniel! Funcionou perfeitamente!
2013/1/11 Daniel Marcelino <dmsilva.br em gmail.com>
> Tem várias possibilidade, use reshape, reshape2, stack, ou plyr.
>
> Por exemplo:
>
> library(reshape)
> dados.long <- melt(dados, id=c("Ind","Tipo"))
>
>
>
> 2013/1/10 Nicolay Cunha <nicolaycunha em gmail.com>
>
>> Prezados,
>>
>>
>> Gostaria de saber se existe alguma maneira automatizada de eu reverter um
>> data.frame para uma planilha de dados como no exemplo abaixo.
>>
>>
>> Grato!
>>
>> Nicolay
>>
>>
>>
>>
>>
>> ####################################################################################################################
>>
>> # Data.frame
>>
>> # a partir disso!
>>
>>
>> Ind
>>
>> Tipo
>>
>> L1
>>
>> L2
>>
>> L3
>>
>> M1
>>
>> M2
>>
>> M2
>>
>> C1
>>
>> C2
>>
>> C3
>>
>> S
>>
>> 1
>>
>> LONGO
>>
>> NA
>>
>> NA
>>
>> NA
>>
>> 20
>>
>> 19
>>
>> 18
>>
>> 15
>>
>> 14
>>
>> 13
>>
>> 30
>>
>> 2
>>
>> MÉDIO
>>
>> 32
>>
>> 31
>>
>> 30
>>
>> NA
>>
>> NA
>>
>> NA
>>
>> 16
>>
>> 15
>>
>> 13
>>
>> 22
>>
>> 3
>>
>> CURTO
>>
>> 33
>>
>> 32.5
>>
>> 31
>>
>> 23
>>
>> 22
>>
>> 21.5
>>
>> NA
>>
>> NA
>>
>> NA
>>
>> 14
>>
>>
>>
>>
>>
>>
>> ####################################################################################################################
>>
>> # Planilha de dados
>>
>> # obter isso!
>>
>>
>> Ind
>>
>> Tipo
>>
>> Ant
>>
>> Pol
>>
>> S
>>
>> 1
>>
>> LONGO
>>
>> M1
>>
>> 20
>>
>> 30
>>
>> 1
>>
>> LONGO
>>
>> M2
>>
>> 19
>>
>> 30
>>
>> 1
>>
>> LONGO
>>
>> M3
>>
>> 18
>>
>> 30
>>
>> 1
>>
>> LONGO
>>
>> C1
>>
>> 15
>>
>> 30
>>
>> 1
>>
>> LONGO
>>
>> C2
>>
>> 14
>>
>> 30
>>
>> 1
>>
>> LONGO
>>
>> C3
>>
>> 13
>>
>> 30
>>
>> 2
>>
>> MÉDIO
>>
>> L1
>>
>> 32
>>
>> 22
>>
>> 2
>>
>> MÉDIO
>>
>> L2
>>
>> 31
>>
>> 22
>>
>> 2
>>
>> MÉDIO
>>
>> L3
>>
>> 30
>>
>> 22
>>
>> 2
>>
>> MÉDIO
>>
>> C1
>>
>> 16
>>
>> 22
>>
>> 2
>>
>> MÉDIO
>>
>> C2
>>
>> 15
>>
>> 22
>>
>> 2
>>
>> MÉDIO
>>
>> C3
>>
>> 13
>>
>> 22
>>
>> 3
>>
>> CURTO
>>
>> L1
>>
>> 33
>>
>> 14
>>
>> 3
>>
>> CURTO
>>
>> L2
>>
>> 32.5
>>
>> 14
>>
>> 3
>>
>> CURTO
>>
>> L3
>>
>> 31
>>
>> 14
>>
>> 3
>>
>> CURTO
>>
>> M1
>>
>> 23
>>
>> 14
>>
>> 3
>>
>> CURTO
>>
>> M2
>>
>> 22
>>
>> 14
>>
>> 3
>>
>> CURTO
>>
>> M3
>>
>> 21.5
>>
>> 14
>>
>>
>>
>>
>>
>> --
>> Nicolay Leme da Cunha
>>
>> Biólogo, Mestre, Doutorando em Ecologia e Conservação
>> Universidade Federal de Mato Grosso do Sul, 79070-900
>> Campo Grande, MS, Brasil
>> E-mail: nicolaycunha em gmail.com
>> lattes.cnpq.br/5916316648872099
>>
>> _______________________________________________
>> 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.
>>
>
>
>
> --
> "Small steps toward a much better world"
>
> \begin{signature}
> Daniel Marcelino
> ☁ dm.silva em umontreal.ca
> ☎ (514) 343 6111 #3799
> ✎ 3200 Jean Brillant, Office C5071
> Montreal, QC; H3T 1N8
> Canada
> \end{signature}
> _______________________________________________
> 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.
>
--
Nicolay Leme da Cunha
Biólogo, Mestre, Doutorando em Ecologia e Conservação
Universidade Federal de Mato Grosso do Sul, 79070-900
Campo Grande, MS, Brasil
E-mail: nicolaycunha em gmail.com
lattes.cnpq.br/5916316648872099
-------------- Próxima Parte ----------
Um anexo em HTML foi limpo...
URL: <http://listas.inf.ufpr.br/pipermail/r-br/attachments/20130111/d12f625e/attachment.html>
Mais detalhes sobre a lista de discussão R-br