Skip to content

Instantly share code, notes, and snippets.

@MajaJelencic
Created February 9, 2015 15:44
Show Gist options
  • Save MajaJelencic/2050503b8eb2a018b17a to your computer and use it in GitHub Desktop.
Save MajaJelencic/2050503b8eb2a018b17a to your computer and use it in GitHub Desktop.
subsampleGenData
subsetGenData <- function(x) {
mp <- droplevels(other(x)$metadata)
iksips <- other(x)$xy
pet <- df2genind(X = genind2df(x, sep = "/"), sep = "/", ind.names = indNames(x),
loc.names = locNames(x))
pet@other$metadata <- mp
pet@other$xy <- iksips
pet
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment