# NOT RUN {
loc1 = list(name = "m1", afreq = c(a = .1, b = .9))
loc2 = list(name = "m2", afreq = c("1" = .2, "10.2" = .3, "3" = .5))
x = setMarkers(singleton(1), locus = list(loc1, loc2))
db = getFreqDatabase(x)
db
y = setFreqDatabase(x, database = db)
stopifnot(identical(x, y))
# The database can also be read directly from file
tmp = tempfile()
write("m1\na 0.1\nb 0.9\n\nm2\n1 0.2\n3 0.5\n10.2 0.3", tmp)
z = setFreqDatabase(x, database = tmp)
stopifnot(all.equal(x, z))
# }
Run the code above in your browser using DataLab