R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(MRS)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/MRS/plot2D.Rd_%03d_medium.png", width=480, height=480)
> ### Name: plot2D
> ### Title: Plot regions of the representative tree in 2D
> ### Aliases: plot2D
>
> ### ** Examples
>
> set.seed(1)
> p = 2
> n1 = 200
> n2 = 200
> mu1 = matrix( c(9,9,0,4,-2,-10,3,6,6,-10), nrow = 5, byrow=TRUE)
> mu2 = mu1; mu2[2,] = mu1[2,] + 1
>
> Z1 = sample(5, n1, replace=TRUE)
> Z2 = sample(5, n2, replace=TRUE)
> X1 = mu1[Z1,] + matrix(rnorm(n1*p), ncol=p)
> X2 = mu2[Z2,] + matrix(rnorm(n2*p), ncol=p)
> X = rbind(X1, X2)
> colnames(X) = c(1,2)
> G = c(rep(1, n1), rep(2,n2))
>
> ans = mrs(X, G, K=8)
> plot2D(ans, type = "prob", legend = TRUE)
>
> plot2D(ans, type="empty", data.points = "differential",
+ background = "none")
>
> plot2D(ans, type="none", data.points = "differential",
+ background = "smeared", levels = 4)
>
>
>
>
>
> dev.off()
null device
1
>