<html><head></head><body><div style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:13px;"><div><div><div style="font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;"><div>Deu o mesmo erro.</div><div><br></div><div>eu fiz assim:</div><div><br></div><div><br></div><div><div style="font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;"><div>labelDataset <- function(data) {</div><div> correctLabel <- function(x) {</div><div><br clear="none"></div><div> if(!is.null(attributes(x)$labels)) {</div><div> class(attributes(x)$labels) <- typeof(x)</div><div> }</div><div> return(x)</div><div> }</div><div> for(i in colnames(data)) {</div><div> data[, i] <- correctLabel(data[, i])</div><div> }</div><div> return(data)</div><div>}</div></div><div style="font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;"><br clear="none"></div><div style="font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;"><span style="color: rgb(34, 34, 34);">Gss2002</span> <- labelDataset(Gss2002)</div><div style="font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;"><br></div><div style="font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;"><br></div><div style="font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;">BOXPLOT(age)</div><br></div></div><br></div><div><br></div><div class="ydp6233aefsignature"><div><font color="#0000ff">Edmar</font></div></div></div>
<div><br></div><div><br></div>
<div id="yahoo_quoted_2131604367" class="yahoo_quoted">
<div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
<div>
Em segunda-feira, 26 de março de 2018 13:06:48 BRT, Conrado Mco <conradomattei@gmail.com> escreveu:
</div>
<div><br></div>
<div><br></div>
<div><div id="yiv1094773457"><div><div dir="ltr">Boa tarde Edmar,<div><br clear="none"></div><div>tente usar essa função:<br clear="none"><br clear="none"><div>labelDataset <- function(data) {</div><div> correctLabel <- function(x) {</div><div><br clear="none"></div><div> if(!is.null(attributes(x)$labels)) {</div><div> class(attributes(x)$labels) <- typeof(x)</div><div> }</div><div> return(x)</div><div> }</div><div> for(i in colnames(data)) {</div><div> data[, i] <- correctLabel(data[, i])</div><div> }</div><div> return(data)</div><div>}</div></div><div><br clear="none"></div><div>
<span style="color:rgb(34,34,34);">Gss2002</span> <- labelDataset(Gss2002)</div><div><br clear="none"></div><div>Tamo junto,</div></div><div class="yiv1094773457gmail_extra"><br clear="none"><div class="yiv1094773457gmail_quote">Em 26 de março de 2018 11:58, Edmar Caldas via R-br <span dir="ltr"><<a rel="nofollow" shape="rect" ymailto="mailto:r-br@listas.c3sl.ufpr.br" target="_blank" href="mailto:r-br@listas.c3sl.ufpr.br">r-br@listas.c3sl.ufpr.br</a>></span> escreveu:<br clear="none"><blockquote class="yiv1094773457gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="yiv1094773457yqt4263982700" id="yiv1094773457yqt54204"><div><div style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:13px;"><div><div>Eu estou usando RStudio Version 1.0.136.</div><div><br clear="none"></div><div>eu só fiz isso até agora.</div><div><br clear="none"></div><div><br clear="none"></div><div><div>library(haven)</div><div>Gss2002 <- read_sav("Diretorio")</div><div>View(Gss20022)</div><div>attach(Gss2002)</div><div><br clear="none"></div><div>mean(age)</div><div>mean(age, na.rm=TRUE)</div><div>is.numeric(age)</div><div>boxplot(age)</div><br clear="none"></div><span class="yiv1094773457"></span><div>Error: `x` and `labels` must be same type<br clear="none"></div><div><br clear="none"></div><div class="yiv1094773457m_-7148357545852341213ydpc49f9f0fsignature"><div><font color="#0000ff">Edmar</font></div></div></div><div><div class="yiv1094773457h5">
<div><br clear="none"></div><div><br clear="none"></div>
<div class="yiv1094773457m_-7148357545852341213yahoo_quoted" id="yiv1094773457m_-7148357545852341213yahoo_quoted_2496778021">
<div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
<div>
Em segunda-feira, 26 de março de 2018 11:51:59 BRT, Jasmine Moreira <<a rel="nofollow" shape="rect" ymailto="mailto:jasmine.moreira.2013@gmail.com" target="_blank" href="mailto:jasmine.moreira.2013@gmail.com">jasmine.moreira.2013@gmail. com</a>> escreveu:
</div>
<div><br clear="none"></div>
<div><br clear="none"></div>
<div><div id="yiv1094773457m_-7148357545852341213yiv6756751602"><div>Edmar, <div class="yiv1094773457m_-7148357545852341213yiv6756751602"><br clear="none" class="yiv1094773457m_-7148357545852341213yiv6756751602"></div><div class="yiv1094773457m_-7148357545852341213yiv6756751602">Vc precisa postar o código, senão fica difícil ajudar. </div><div class="yiv1094773457m_-7148357545852341213yiv6756751602"><br clear="none" class="yiv1094773457m_-7148357545852341213yiv6756751602"></div><div class="yiv1094773457m_-7148357545852341213yiv6756751602">[]s</div><div class="yiv1094773457m_-7148357545852341213yiv6756751602">Jasmine<br clear="none" class="yiv1094773457m_-7148357545852341213yiv6756751602"><div><br clear="none" class="yiv1094773457m_-7148357545852341213yiv6756751602"><blockquote class="yiv1094773457m_-7148357545852341213yiv6756751602" type="cite"><div class="yiv1094773457m_-7148357545852341213yiv6756751602">Em 26 de mar de 2018, à(s) 11:39, Edmar Caldas via R-br <<a rel="nofollow" shape="rect" class="yiv1094773457m_-7148357545852341213yiv6756751602" ymailto="mailto:r-br@listas.c3sl.ufpr.br" target="_blank" href="mailto:r-br@listas.c3sl.ufpr.br">r-br@listas.c3sl.ufpr.br</a>> escreveu:</div><br clear="none" class="yiv1094773457m_-7148357545852341213yiv6756751602Apple-interchange-newline"><div class="yiv1094773457m_-7148357545852341213yiv6756751602"><div class="yiv1094773457m_-7148357545852341213yiv6756751602yqt4616511270" id="yiv1094773457m_-7148357545852341213yiv6756751602yqt24807"><div class="yiv1094773457m_-7148357545852341213yiv6756751602"><div class="yiv1094773457m_-7148357545852341213yiv6756751602" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:13px;"><div class="yiv1094773457m_-7148357545852341213yiv6756751602">Bom Dia!</div><div class="yiv1094773457m_-7148357545852341213yiv6756751602"><br clear="none" class="yiv1094773457m_-7148357545852341213yiv6756751602"></div><div class="yiv1094773457m_-7148357545852341213yiv6756751602">estou trabalhando com um arquivo SPSS. Ao fazer um boxplot aparece essa mensagem. </div><div class="yiv1094773457m_-7148357545852341213yiv6756751602"><br clear="none" class="yiv1094773457m_-7148357545852341213yiv6756751602"></div><div class="yiv1094773457m_-7148357545852341213yiv6756751602">Error: 'x' and labels' must be same type.</div><div class="yiv1094773457m_-7148357545852341213yiv6756751602"><br clear="none" class="yiv1094773457m_-7148357545852341213yiv6756751602"></div><div class="yiv1094773457m_-7148357545852341213yiv6756751602"><br clear="none" class="yiv1094773457m_-7148357545852341213yiv6756751602"></div><div class="yiv1094773457m_-7148357545852341213yiv6756751602"><br clear="none" class="yiv1094773457m_-7148357545852341213yiv6756751602"></div><div class="yiv1094773457m_-7148357545852341213yiv6756751602ydpe53c20ccsignature"><div class="yiv1094773457m_-7148357545852341213yiv6756751602"><font class="yiv1094773457m_-7148357545852341213yiv6756751602" color="#0000ff">Edmar</font></div></div></div></div></div>______________________________ _________________<br clear="none" class="yiv1094773457m_-7148357545852341213yiv6756751602">R-br mailing list<br clear="none" class="yiv1094773457m_-7148357545852341213yiv6756751602"><a rel="nofollow" shape="rect" class="yiv1094773457m_-7148357545852341213yiv6756751602" ymailto="mailto:R-br@listas.c3sl.ufpr.br" target="_blank" href="mailto:R-br@listas.c3sl.ufpr.br">R-br@listas.c3sl.ufpr.br</a><br clear="none" class="yiv1094773457m_-7148357545852341213yiv6756751602"><a rel="nofollow" shape="rect" target="_blank" href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br">https://listas.inf.ufpr.br/ cgi-bin/mailman/listinfo/r-br</a><br clear="none" class="yiv1094773457m_-7148357545852341213yiv6756751602">Leia o guia de postagem (<a rel="nofollow" shape="rect" target="_blank" href="http://www.leg.ufpr.br/r-br-guia">http://www.leg.ufpr.br/r-br- guia</a>) e forneça código mínimo reproduzível.</div></blockquote></div><br clear="none" class="yiv1094773457m_-7148357545852341213yiv6756751602"></div></div></div></div>
</div>
</div></div></div></div></div></div><br clear="none">______________________________ _________________<br clear="none">
R-br mailing list<br clear="none">
<a rel="nofollow" shape="rect" ymailto="mailto:R-br@listas.c3sl.ufpr.br" target="_blank" href="mailto:R-br@listas.c3sl.ufpr.br">R-br@listas.c3sl.ufpr.br</a><br clear="none">
<a rel="nofollow" shape="rect" target="_blank" href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br">https://listas.inf.ufpr.br/ cgi-bin/mailman/listinfo/r-br</a><br clear="none">
Leia o guia de postagem (<a rel="nofollow" shape="rect" target="_blank" href="http://www.leg.ufpr.br/r-br-guia">http://www.leg.ufpr.br/r-br- guia</a>) e forneça código mínimo reproduzível.<br clear="none"></blockquote></div><br clear="none"></div></div></div></div>
</div>
</div></div></body></html>