<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><span><div>Caro Benilton,</div><div><br></div><div style="background-color: transparent;">Segue um exemplo reproduzível.</div><div style="background-color: transparent;"><br></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;">library(RColorBrewer)</div><div><br></div><div>dfm <- data.frame(Solo=c("LVA", "LVD"), col=rep("#000000", 2))</div><div><br></div><div>mypalette <- brewer.pal(3,"Greys")</div><div><br></div><div>var <- data.frame(wrong=unique(dfm$Sol),</div><div>                 
 right=mypalette[2:3])</div><div><br></div><div>for (i in seq(along = dimnames(var)[[1L]])){</div><div>  dfm[,2][which(dfm[,1] == var[[i,1]])] <- var[[i,2]]</div><div>}</div></span></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"> </div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;">Obrigado</div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"><br></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"><br></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"><font face="times new roman, new york, times, serif">Alisson Lucrécio da Costa</font><br></div>  <div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"> <div
 style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"> <div dir="ltr"> <hr size="1">  <font size="2" face="Arial"> <b><span style="font-weight:bold;">From:</span></b> Benilton Carvalho <beniltoncarvalho@gmail.com><br> <b><span style="font-weight: bold;">To:</span></b> r-br <r-br@listas.c3sl.ufpr.br>; Alisson Lucrecio <alissonluc@yahoo.com.br> <br> <b><span style="font-weight: bold;">Sent:</span></b> Wednesday, May 22, 2013 10:26 AM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [R-br] Duvida plot base1<br> </font> </div> <div class="y_msg_container"><br>dificil, muito dificil, ser preciso na ausencia de um exemplo reproduzivel...<br><br>mas, acho que o problema resume-se 'a falta de aspas em torno do valor...<br><br>blah <- '#D9D9D9'<br><br>b<br><br>Em 22 de maio de 2013 10:16, Alisson Lucrecio<br><<a ymailto="mailto:alissonluc@yahoo.com.br"
 href="mailto:alissonluc@yahoo.com.br">alissonluc@yahoo.com.br</a>> escreveu:<br>> Caro Colegas,<br>> Bom dia.<br>><br>> Eu estou tentando construir uma PCA no base, mas estou entendo alguns<br>> problema.<br>><br>> Tenho uma data.frame com uma célula com valor "#F7F7F7" (dm.x[,1+i]) e<br>> gostaria de substitui-la por outro valor de acordo com o valor de uma célula<br>> especifica,<br>><br>> assim tenho:<br>><br>> dm.x[,2][which(dm.x[,1] == 0)] <- #D9D9D9<br>><br>><br>> Erro.<br>><br>> Mensagens de aviso perdidas:<br>> In `[<-.factor`(`*tmp*`, which(dm.x[, 1 + i] == var[[ii, 1]]), value =<br>> c(NA_integer_,  :<br>>   invalid factor level, NAs generated<br>><br>> Obrigando<br>><br>> Alisson Lucrécio da Costa<br>><br>> _______________________________________________<br>> R-br mailing list<br>> <a ymailto="mailto:R-br@listas.c3sl.ufpr.br"
 href="mailto:R-br@listas.c3sl.ufpr.br">R-br@listas.c3sl.ufpr.br</a><br>> <a href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br" target="_blank">https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br</a><br>> Leia o guia de postagem (<a href="http://www.leg.ufpr.br/r-br-guia" target="_blank">http://www.leg.ufpr.br/r-br-guia</a>) e forneça código<br>> mínimo reproduzível.<br><br></div> </div> </div>  </div></body></html>