Description Usage Arguments Author(s) Examples
BalanceSplit help quickly splitting a data frame into balanced parts according to specified cluster factor.
1 2 3 4 5 6 7 8  |   BalanceSplit(data,
             cluster,
             nsplit = 2,
             seed.range=1:500,
             p.cutoff=0.1)
   summary.BalanceSplit(BalanceList,
                        upset.seed=c(3,11),
                        set=1)
 | 
data | 
 a data frame containing cluster cols.  | 
cluster | 
 cluster colnames.  | 
nsplit | 
 the number of balance splitting.Default is 2.  | 
seed.range | 
 candidate seeds.Default is 1:500.  | 
p.cutoff | 
 the cut off of P value.Default is 0.1.  | 
Weibin Huang<654751191@qq.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18  | library(lucky)
Plus.library(c("tableone","knitr"))
data(data.TableOne)
data=data.TableOne
cluster = c("age","gender","his1","his2","his.grade","Stage","pT","N.status","M.status","chem.status")
L <- BalanceSplit(data,
                  cluster,
                  nsplit = 2,
                  seed.range=1:500,
                  p.cutoff=0.1)
table1 <- L[["seed_456"]][["table"]]
kable(table1[,1:3],align = 'c')
data.TableOne2 <- L[["seed_456"]][["data"]]
## use upset plot to visualize the difference between seeds
summary.BalanceSplit(BalanceList = L,
                     upset.seed=c(3,11),
                     set=1)
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.