# NOT RUN {
slist <- readQ(list.files(path=system.file("files/structure",package="pophelper"),full.names=TRUE))
# plot one separate figure
plotQ(qlist=slist[1])
# plot two separate figures
plotQ(qlist=slist[1:2])
# plot a joined figure with multiple plots
plotQ(qlist=slist[1:2],imgoutput="join")
# sort individuals
plotQ(qlist=slist[c(1,3)],sortind="all")
plotQ(qlist=slist[c(1,3)],sortind="all",imgoutput="join")
# read group labels
grps1 <- read.delim(system.file("files/structuregrplabels.txt", package="pophelper"), header=F,stringsAsFactors=F)
# plot with labels
plotQ(qlist=slist[1],grplab=list("grps\n"=grps1$V1))
plotQ(qlist=slist[1:2],grplab=list("grps\n"=grps1$V1),imgoutput="join")
# sort within groups
plotQ(qlist=slist[1:2],grplab=list("grps\n"=grps1$V1),imgoutput="join",sortind="Cluster1")
# plot two sets of labels
grps2 <- read.delim(system.file("files/structuregrplabels2.txt", package="pophelper"), header=F,stringsAsFactors=F)
plotQ(qlist=slist[1],grplab=list("grps\n"=grps1$V1,"grps2\n"=grps2$V1))
plotQ(qlist=slist[1:2],grplab=list("grps2\n"=grps2$V1,"grps\n"=grps1$V1),imgoutput="join",height=1.5,labpanelheight=1.2)
# plot a custom dataframe
temp <- list("custom"=data.frame(Cluster1=c(0.2,0.3,0.6,0.8),Cluster2=c(0.8,0.7,0.4,0.2)))
plotQ(temp)
# }
Run the code above in your browser using DataLab