<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div class="">Dear Adegenet forum,</div>
<div class=""><br class="">
</div>
<div class="">I created a genind object using the “read.structure” command. As you see in the code below - I specified the columns [,3:8] as “other”. These original data contain four traits, and xy coordinates [,7:8]. After conversion to a genind object, the
resulting structure of @other is a list with one object, $X, which is a 158 x 6 matrix. The columns represent the four traits and the x,y data stored in separate columns.</div>
<div class=""><br class="">
</div>
<div class="">How can I reformat $X to contain five objects: the four traits (each as a separate object), and an xy matrix as a single matrix with dimensions 158 x 2 for use in a downstream sPCA? </div>
<div class=""><br class="">
</div>
<div class="">Many thanks in advance for help.</div>
<div class="">Caroline</div>
<div class=""><br class="">
</div>
<div class="">------------------------------------------------------</div>
<div class=""><br class="">
</div>
<div class="">> mydata <- read.structure("~/Documents/Trochilus/second_chapter/Analysis/structure/input/GBS_all_pop_pheno.stru", </div>
<div class="">+ <span class="Apple-tab-span" style="white-space:pre"></span>n.ind=158, </div>
<div class="">+ <span class="Apple-tab-span" style="white-space:pre"></span>n.loc=6451, </div>
<div class="">+ <span class="Apple-tab-span" style="white-space:pre"></span>onerowperin=TRUE,</div>
<div class="">+ <span class="Apple-tab-span" style="white-space:pre"></span>col.lab=1,</div>
<div class="">+ <span class="Apple-tab-span" style="white-space:pre"></span>col.pop=2,</div>
<div class="">+ <span class="Apple-tab-span" style="white-space:pre"></span>col.others=3:8,</div>
<div class="">+ <span class="Apple-tab-span" style="white-space:pre"></span>row.marknames=0,</div>
<div class="">+ <span class="Apple-tab-span" style="white-space:pre"></span>ask=FALSE,</div>
<div class="">+ <span class="Apple-tab-span" style="white-space:pre"></span> )</div>
<div class=""><br class="">
</div>
<div class=""> Converting data from a STRUCTURE .stru file to a genind object... </div>
<div class=""><br class="">
</div>
<div class="">> mydata@other</div>
<div class="">$X</div>
<div class=""> [,1] [,2] [,3] [,4] [,5] [,6] </div>
<div class="">1 "female" "black" "1" "3.72" "18.02911667" "-76.3886" </div>
<div class="">2 "female" "black" "1" "3.55" "18.02911667" "-76.3886" </div>
<div class="">3 "male" "black" "1" "3.97" "18.02953333" "-76.38783333"</div>
<div class="">4 "male" "black" "1" "3.55" "18.0337" "-76.38993333"</div>
<div class="">5 "female" "black" "1" "3.735" "18.0337" "-76.38993333"</div>
<div class="">6 "male" "black" "1" "3.95" "18.0295" "-76.38831667"</div>
<div class="">7 "male" "black" "1" "3.99" "18.02953333" "-76.38783333"</div>
<div class=""><br class="">
</div>
<div class="">
<div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">
Caroline D. Judy<br class="">
PhD Candidate (LSU)<br class="">
Peter Buck Predoctoral Fellow (NMNH)<br class="">
email: <a href="mailto:judyc@si.edu" class="">judyc@si.edu</a><br class="">
<br class="">
<br class="">
</div>
</div>
<br class="">
</body>
</html>