<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt"><div><span><br></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><span>Agradeço pela ajuda, mas....</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><span>Continua não dando certo.....!!!</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><span>Olha só a saída:</span></div><div style="background-color: transparent;"> GBS =
read.csv('tpg12-06-0006-dataset-s2', header=TRUE, stringsAsFactors=FALSE)</div><div style="background-color: transparent;">Error in file(file, "rt") : cannot open the connection</div><div style="background-color: transparent;">In addition: Warning message:</div><div style="background-color: transparent;">In file(file, "rt") :</div><div style="background-color: transparent;"> cannot open file 'tpg12-06-0006-dataset-s2': No such file or directory</div><div style="background-color: transparent;">> parse.GBS <- function(x) {</div><div style="background-color: transparent;">+ unique.x <- unique(x)</div><div style="background-color: transparent;">+ alleles <- setdiff(unique.x,union("H","N"))</div><div style="background-color: transparent;">+ y <- rep(0,length(x))</div><div style="background-color: transparent;">+ y[which(x==alleles[1])] <- -1</div><div style="background-color:
transparent;">+ y[which(x==alleles[2])] <- 1</div><div style="background-color: transparent;">+ y[which(x=="N")] <- NA</div><div style="background-color: transparent;">+ return(y)</div><div style="background-color: transparent;">+ }</div><div style="background-color: transparent;">> X <- apply(GBS[,-c(1:3)],1,parse.GBS)</div><div style="background-color: transparent;">Error in apply(GBS[, -c(1:3)], 1, parse.GBS) : object 'GBS' not found</div><div style="background-color: transparent;">> dim(X)</div><div style="background-color: transparent;">[1] 12 4</div><div style="background-color: transparent;">> frac.missing <- apply(X,2,function(z){length(which(is.na(z)))/length(z)})</div><div style="background-color: transparent;">> GBS = read.csv('tpg12-06-0006-dataset-s2', header=TRUE, stringsAsFactors=FALSE)</div><div style="background-color: transparent;">Error in file(file, "rt") : cannot
open the connection</div><div style="background-color: transparent;">In addition: Warning message:</div><div style="background-color: transparent;">In file(file, "rt") :</div><div style="background-color: transparent;"> cannot open file 'tpg12-06-0006-dataset-s2': No such file or directory</div><div style="background-color: transparent;"><span></span></div><div style="background-color: transparent;"><br></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal;"><br></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal;">E agora, poderia me ajudar ???? </div><div><br></div><div class="yahoo_quoted" style="display: block;"> <br> <br> <div style="font-family:
HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12pt;"> <div style="font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12pt;"> <div dir="ltr"> <font size="2" face="Arial"> Em Quarta-feira, 20 de Novembro de 2013 12:07, Benilton Carvalho <beniltoncarvalho@gmail.com> escreveu:<br> </font> </div> <div class="y_msg_container"><div id="yiv8974240481"><div><div dir="ltr">use apenas:<div><br clear="none"></div><div>GBS = read.csv('tpg12-06-0006-dataset-s2', header=TRUE, stringsAsFactors=FALSE)<br clear="none"></div><div><br clear="none"></div><div>a razao deixo como exercicio p vc...</div><div><br clear="none"></div><div>
b</div></div><div class="yiv8974240481gmail_extra"><br clear="none"><br clear="none"><div class="yiv8974240481gmail_quote">Em 20 de novembro de 2013 11:37, Giselle Davi <span dir="ltr"><<a rel="nofollow" shape="rect" ymailto="mailto:giselle_davi@yahoo.com.br" target="_blank" href="mailto:giselle_davi@yahoo.com.br">giselle_davi@yahoo.com.br</a>></span> escreveu:<br clear="none">
<blockquote class="yiv8974240481gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="yiv8974240481yqt0710224312" id="yiv8974240481yqt17587"><div><div style="font-size: 12pt; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"><div>
Prezados,</div><div><br clear="none"></div><div style="background-color:transparent;">estou tendo problemas em rodar a análise conforme manual do R: <span style="background-color:transparent;">Genomic prediction with rrBLUP 4</span></div>
<div style="background-color:transparent;">Jeffrey Endelman,<span style="background-color:transparent;font-size:12pt;">June 15, 2013</span><span style="background-color:transparent;font-size:12pt;"> . Ao rodar a análise igual ao solicitado no manual a dim (X) resulta em NULL . Vcs poderiam me ajudar a encontrar a dimensão correta desta matriz ??</span></div>
<div style="font-style: normal; font-size: 12pt; background-color: transparent; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"><span style="background-color:transparent;font-size:12pt;"><br clear="none">
</span></div><div style="background-color:transparent;">Aqui está o local indicado, conforme manual, de onde está a planilha de dados: <span style="background-color:transparent;"><a rel="nofollow" shape="rect" target="_blank" href="https://www.crops.org/publications/tpg/supplements/5/tpg12-06-0006-dataset-s2.gz">https://www.crops.org/publications/tpg/supplements/5/tpg12-06-0006-dataset-s2.gz</a></span></div>
<div style="font-style: normal; font-size: 16px; background-color: transparent; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"><span style="background-color:transparent;"><br clear="none">
</span></div><div style="background-color:transparent;">OBS.: O nome do arquivo está diferente, pois na hora de baixar do mesmo site, o arquivo passa a ter o nome conforme indicado na rotina abaixo, porém é o mesmo arquivo com os mesmos dados.</div>
<div style="background-color:transparent;"><br clear="none"></div><div style="font-style: normal; font-size: 16px; background-color: transparent; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;">
Abaixo segue a rotina:</div><div style="background-color:transparent;">GBS <- read.csv("C:/GS_tutorial/DatasetS2_29SAWSN_gbs.csv", sep=";", dec=",",header=TRUE)</div><div style="background-color:transparent;">
parse.GBS <- function(x) {</div><div style="background-color:transparent;"> unique.x <- unique(x)</div><div style="background-color:transparent;"> alleles <- setdiff(unique.x,union("H","N"))</div>
<div style="background-color:transparent;"> y <- rep(0,length(x))</div><div style="background-color:transparent;"> y[which(x==alleles[1])] <- -1</div><div style="background-color:transparent;"> y[which(x==alleles[2])] <- 1</div>
<div style="background-color:transparent;"> y[which(x=="N")] <- NA</div><div style="background-color:transparent;"> return(y)</div><div style="background-color:transparent;">}</div><div style="background-color:transparent;">
X <- apply(GBS[,-c(1:3)],1,parse.GBS)</div><div style="background-color:transparent;">dim(X)</div><div style="background-color:transparent;">frac.missing <- apply(X,2,function(z){length(which(<a rel="nofollow" shape="rect" target="_blank" href="http://is.na/">is.na</a>(z)))/length(z)})</div>
<div style="background-color:transparent;">length(which(frac.missing<0.5))</div><div>hist(frac.missing)<br clear="none"></div><div><br clear="none"></div><div><br clear="none"></div><div>Desde já agradeço. Att,</div><div><br clear="none"></div><div>Giselle</div><div><br clear="none">
</div><div><br clear="none"></div><div style="font-style: normal; font-size: 16px; background-color: transparent; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"><br clear="none"></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><br><br></div> </div> </div> </div> </div></body></html>