[adegenet-forum] data input

Vojtěch Zeisek vojta at trapa.cz
Fri Nov 28 11:43:04 CET 2014


Hello

Dne Pá 28. listopadu 2014 10:26:09, Mark Coulson napsal(a):
> I should mention that I have a data set with ~12,000 individuals. Is there
> a way to add in an @other column to a dataframe and have adegenet read it
> as such?

You can use same way as I suggested. You can generate the variable using, for 
example, function rep(). See ?rep Two examples:
rep(c("Danube", "Moldau"), each=600)
rep(c("Danube", "Moldau"), times=c(650, 550))
I don't use genepop, so I'm not sure. I'm usually using read.loci() function 
which has parameter col.pop - You define there number of column with 
population information.
I think import2genind isn't able to do what You wish. But I'd suggest You to 
extract respective column from You dataset into separate file, read it into 
YourSortingVariable by read.csv or read.table, e.g.
YourSortingVariable <- read.csv("rivers.csv", header=TRUE, sep="\t", quote="", 
row.names=1)
(see ?read.csv for all possibilities) and then like I suggested previously do
YourData$other <- YourSortingVariable
This should work.
Yours,
Vojtěch

-- 
Vojtěch Zeisek
http://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University in Prague
Benátská 2, Prague, 12801, CZ
http://botany.natur.cuni.cz/en/

Institute of Botany, Academy of Science
Zámek 1, Průhonice, 25243, CZ
http://www.ibot.cas.cz/en/

Czech Republic
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20141128/06d1d451/attachment.sig>


More information about the adegenet-forum mailing list