<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><span>Boa tarde,</span></div><div><span></span> </div><div><span>tenho uma solucao nao muito inteligente para o que venho perguntar e gostaria de obter algo mais otimizado. Tenho um data frame com 40 variaveis (fatores) e cada um com diversos níveis. Algo por exemplo:</span></div><div><span></span> </div><div><span>Variável satisfacao<span class="tab"> <span class="tab"> <span class="tab"> <span class="tab"> <span class="tab"> <span class="tab"> <span class="tab"> Variável aprendizado<span class="tab"> <span class="tab"> <span class="tab"> <span
class="tab"> <span class="tab"> <span class="tab"> Variável outrosplanos</span></span></span></span></span></span></span></span></span></span></span></span></span></span></div><div><span>muito satisfeito<span class="tab"> <span class="tab"> <span class="tab"> <span class="tab"> <span class="tab"> <span class="tab"> <span class="tab"> <span class="tab"> <span class="tab"> aprendo todos os dias<span class="tab"> <span class="tab"> <span class="tab"> <span class="tab"> <span class="tab"> <span class="tab"> posso mudar
planos</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></div><div><span>nem satisfeito nem insatisfeito<span class="tab"> <span class="tab"> <span class="tab"> aprendo 1 vez na semana<span class="tab"> <span class="tab"> <span class="tab"> <span class="tab"> <span class="tab"> <span class="tab"> preciso consultar o chefe mas posso mudar </span></span></span></span></span></span></span></span></span></span></div><div><span>muito insatisfeito<span class="tab"> <span class="tab"> <span class="tab"> <span class="tab"> <span class="tab"> <span class="tab"> <span
class="tab"> <span class="tab"> <span class="tab"> aprendo 1 vez ao mes<span class="tab"> <span class="tab"> <span class="tab"> <span class="tab"> <span class="tab"> <span class="tab"> nao posso mudar nunca</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></div><div><span><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"> <span class="tab"> <span class="tab"> <span class="tab"> <span class="tab"> <span class="tab"> <span
class="tab"> <span class="tab"> <span class="tab"> <span class="tab"> <span class="tab"> <span class="tab"> </span></span></span></span></span></span></span></span></span></span></span></span> <span class="tab"> <span class="tab"> <span class="tab"> aprendo raramente <span class="tab"> <span class="tab"> <span class="tab"> <span class="tab"> <span class="tab"> <span class="tab"> <span class="tab"> <span class="tab"> <span class="tab"> <span class="tab"> <span class="tab"> <span
class="tab"> <span class="tab"> <span class="tab"> </span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></div><div><span><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"> <span class="tab"> <span class="tab"> <span class="tab"> <span class="tab"> <span class="tab"> <span class="tab"> <span class="tab"> <span class="tab"> <span class="tab"> <span
class="tab"> <span class="tab"> <span class="tab"> <span class="tab"> <span class="tab"> <span class="tab"> nao aprendo algo novo nunca</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></div><div><span><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span
class="tab"></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span> </div><div><span><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab">Tenho por exemplo 10 variáveis do estilo da "satisfacao", 20 da "aprendizado" e 10 da "outrosplanos", agora quero ter nos näiveis números e nao frases, "1","2","3".</span></span></span></span></span></span></span></span></span></span></span></span></div><div><span><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab">A princ#ipio pensei em fazer manualmente para cada uma e depois unir
todas as variáveis em um novo conjunto de dados:</span></span></span></span></span></span></span></span></span></span></span></span></div><div><span><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"></span></span></span></span></span></span></span></span></span></span></span></span> </div><div><span><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab">newsatisfacao<-factor(data$satisfacao, levels=c("muito satisfeito","nemsatisfeito nem insatisfeito","muito insatisfeito"),labels=c("1","2","3"))</span></span></span></span></span></span></span></span></span></span></span></span></div><div><span><span class="tab"><span class="tab"><span class="tab"><span
class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab">.....</span></span></span></span></span></span></span></span></span></span></span></span></div><div><span><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab">newdata<-cbind(newsatisfacao, newaprendizado...)</span></span></span></span></span></span></span></span></span></span></span></span></div><div><span><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"></span></span></span></span></span></span></span></span></span></span></span></span> </div><div><span><span class="tab"><span class="tab"><span class="tab"><span
class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab"><span class="tab">Assim eu teria o que quero, mas é muito trabalhoso e nao prático! Gostaria de poder renomear os níveis de forma mais dinamica e rápida, de repente sem ter que criar uma nova variável, só renomeá-los. Poder dizer que para todas as variáveis que tem as opcoes "muito satisfeito","nemsatisfeito nem insatisfeito","muito insatisfeito", devem ser renomeadas para "1","2","3" e assim por diante.</span></span></span></span></span></span></span></span></span></span></span></span></div><div> </div><div> Abracos,</div><div> </div><div><span style="font-size: 16px;">-- <br>Daniela Rodrigues Recchia</span></div><div><span style="font-size: 16px;">M.Sc. in Statistics<br></span></div><div style="color: rgb(0, 0, 0); font-family: arial, helvetica, clean, sans-serif; font-style: normal; background-color:
transparent;"><span style="font-size: medium;"><br></span></div><div style="color: rgb(0, 0, 0); font-family: arial, helvetica, clean, sans-serif; font-style: normal; background-color: transparent;"><span style="font-size: 13px;">Tel. (Mobil): +49 01578 7588382</span></div><div><span style="font-size: 16px;">Kißlegg - Germany</span></div><div><span style="font-size: small;"><br></span></div><div><span style="font-size: x-small;"><br></span></div><div><span style="font-size: x-small;"><span style='line-height: 18px; font-family: "helvetica neue", arial, sans-serif; font-style: italic;'>“The standard of success in life is absolutely the amount of joy you feel”</span><br></span></div><div style="background-color: transparent;"><span style="font-size: small;"><span style="font-size: x-small;"><span style='line-height: 18px; font-family: "helvetica neue", arial, sans-serif; font-style: italic;'>Esther & Jerry
Hick</span></span><br></span></div><div><span style="font-size: small;"> </span></div></div></body></html>