²é¿´: 487  |  »Ø¸´: 3

zxwinner

½ð³æ (СÓÐÃûÆø)

[ÇóÖú] R ÓïÑÔ±à³Ì ÈçºÎʵÏÖÒ»¸öº¯ÊýµÄ¹¦ÄÜ ÒÑÓÐ1È˲ÎÓë

ÈçºÎ¶¨ÒåÒ»¸öº¯Êý¿ÉÒÔ²úÉúÉ¢µãͼ£¿

  make a function to generate a scatter plot of any two user-supplied arbitrary rows for the dataset. The three inputs will be the matrix, and the two columns to plot
»Ø¸´´ËÂ¥

» ²ÂÄãϲ»¶

» ±¾Ö÷ÌâÏà¹Ø¼ÛÖµÌùÍÆ¼ö£¬¶ÔÄúͬÑùÓаïÖú:

ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

FMStation

ÖÁ×ðľ³æ (ÖªÃû×÷¼Ò)

¡¾´ð°¸¡¿Ó¦Öú»ØÌû

¡ï ¡ï ¡ï
¸Ðл²ÎÓ룬ӦÖúÖ¸Êý +1
zxwinner: ½ð±Ò+3, ¡ïÓаïÖú 2016-10-18 21:39:46
CODE:
# Scatterplot Matrices from the glus Package
library(gclus)
dta <- mtcars[c(1,3,5,6)] # get data
dta.r <- abs(cor(dta)) # get correlations
dta.col <- dmat.color(dta.r) # get colors
# reorder variables so those with highest correlation
# are closest to the diagonal
dta.o <- order.single(dta.r)
cpairs(dta, dta.o, panel.colors=dta.col, gap=.5,
main="Variables Ordered and Colored by Correlation" )

2Â¥2016-10-17 22:42:09
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

zxwinner

½ð³æ (СÓÐÃûÆø)

ÒýÓûØÌû:
2Â¥: Originally posted by FMStation at 2016-10-17 22:42:09
# Scatterplot Matrices from the glus Package
library(gclus)
dta <- mtcars # get data
dta.r <- abs(cor(dta)) # get correlations
dta.col <- dmat.color(dta.r) # get colors
# reorder va ...

ÏëÎÊÏ compositionÊÇʲôÒâ˼£¬²»Ì«Àí½âÎÊÌâÒªÈÃÎÒ¸Éʲô£¿
convert the variables in the matrix from function 1 to a composition in two different ways. The simplest way to do this is to divide each row value by its column sum. You may choose any two of the below methods.

function1: randomdataset <- function(s, nr, m1, m2){
  size <- s
  r <- matrix(data=NA, nrow=nr, ncol=s)
  for(i in 1:10){ r[,i] <- rnorm(nr, mean=m1, sd=5) }
  for(i in 1:5){ r[1:size,i] <- rnorm(size, mean=m2, sd=5) }
  return(r)
}
3Â¥2016-10-17 22:49:24
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

FMStation

ÖÁ×ðľ³æ (ÖªÃû×÷¼Ò)

¡¾´ð°¸¡¿Ó¦Öú»ØÌû

¡ï ¡ï ¡ï ¡ï ¡ï
zxwinner: ½ð±Ò+5 2016-12-08 07:32:04
http://www.dictionary.com/browse/composition
the act of combining parts or elements to form a whole.

https://tw.dictionary.search.yah ... on&fr2=dict
ºÏ³ÉÎ·ÂÔìÎï[C]

convert the variables in the matrix:

·½·¨1.  divide each row value by its column sum.

·½·¨2.
  for(i in 1:10){ r[,i] <- rnorm(nr, mean=m1, sd=5) }

·½·¨3.
  for(i in 1:5){ r[1:size,i] <- rnorm(size, mean=m2, sd=5) }
4Â¥2016-10-18 21:56:32
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû
Ïà¹Ø°æ¿éÌø×ª ÎÒÒª¶©ÔÄÂ¥Ö÷ zxwinner µÄÖ÷Ìâ¸üÐÂ
×î¾ßÈËÆøÈÈÌûÍÆ¼ö [²é¿´È«²¿] ×÷Õß »Ø/¿´ ×îºó·¢±í
[¿¼ÑÐ] ²ÄÁÏѧ˶£¬Çóµ÷¼Á 6+4 ÌǺù«888ll 2026-03-22 9/450 2026-03-25 11:19 by greychen00
[¿¼ÑÐ] ¸÷λÀÏʦÄúºÃ£º±¾È˳õÊÔ372·Ö +4 jjÓ¿77 2026-03-25 4/200 2026-03-25 11:17 by shulmg
[¿¼ÑÐ] 278Çóµ÷¼Á +4 ÎÒ¿ÉÒÔÉϰ¶µÄ¶Ô 2026-03-19 4/200 2026-03-25 11:01 by userper
[¿¼ÑÐ] ¿¼Ñе÷¼Á +4 ºôºô£¿~+123456 2026-03-24 4/200 2026-03-24 23:16 by barlinike
[¿¼ÑÐ] 08¹¤Ñ§µ÷¼Á +12 Óû§573181 2026-03-20 17/850 2026-03-24 21:45 by ·¬ÇÑìÀÁËÎ÷ºìÊÁ
[Óлú½»Á÷] ÓлúºÏ³ÉÇóÖú 20+3 FENGSHUJEI 2026-03-23 5/250 2026-03-24 19:31 by 88817753
[¿¼ÑÐ] 085602 289·ÖÇóµ÷¼Á +5 WWWÎ÷Î÷¸¥Ë¹ 2026-03-24 5/250 2026-03-24 18:51 by jhhcooi
[²ÄÁϹ¤³Ì] Ò»Ö¾Ô¸C9²ÄÁÏÓ뻯¹¤×¨Òµ×Ü·Ö300Çóµ÷¼Á +4 Âü111 2026-03-24 5/250 2026-03-24 15:44 by ÐÇ¿ÕÐÇÔÂ
[¿¼ÑÐ] 341Çóµ÷¼Á(Ò»Ö¾Ô¸ºþÄÏ´óѧ070300) +5 ·¬ÇÑÍ·--- 2026-03-22 6/300 2026-03-23 23:45 by Txy@872106
[¿¼ÑÐ] Ò»Ö¾Ô¸±±¾©»¯¹¤´óѧ 070300 ѧ˶ 336·Ö Çóµ÷¼Á +7 vvÃÔ 2026-03-22 7/350 2026-03-23 23:44 by Txy@872106
[¿¼ÑÐ] Ò»Ö¾Ô¸¹ú¿Æ¹ý³ÌËù081700£¬274Çóµ÷¼Á +3 ÈýË®ÑÐ0Ë®Á¢·½ 2026-03-23 3/150 2026-03-23 23:11 by MajorWen
[¿¼ÑÐ] ¹¤¿Æ0856Çóµ÷¼Á +5 ãåÎö͡͡ 2026-03-21 5/250 2026-03-23 17:56 by º£ÉªÞ±-
[¿¼ÑÐ] ±±¿Æ281ѧ˶²ÄÁÏÇóµ÷¼Á +8 tcxiaoxx 2026-03-20 9/450 2026-03-23 12:16 by tcxiaoxx
[¿¼ÑÐ] ʯºÓ×Ó´óѧ£¨211¡¢Ë«Ò»Á÷£©Ë¶²©Ñо¿Éú³¤ÆÚÕÐÉú¹«¸æ +3 Àî×ÓÄ¿ 2026-03-22 3/150 2026-03-22 21:01 by ÔõôÊÍ»³
[¿¼ÑÐ] Ò»Ö¾Ô¸»ªÖÐũҵ071010£¬×Ü·Ö320Çóµ÷¼Á +5 À§À§À§À§À¤À¤ 2026-03-20 6/300 2026-03-22 17:41 by hxsm
[¿¼ÑÐ] Ò»Ö¾Ô¸ÖÐÄÏ»¯Ñ§£¨0703£©×Ü·Ö337Çóµ÷¼Á +9 niko- 2026-03-19 10/500 2026-03-22 16:08 by ColorlessPI
[¿¼ÑÐ] 085600²ÄÁÏÓ뻯¹¤306 +4 z1z2z3879 2026-03-21 4/200 2026-03-21 23:44 by ms629
[¿¼ÑÐ] Çóµ÷¼Á +3 13341 2026-03-20 3/150 2026-03-21 18:28 by ѧԱ8dgXkO
[¿¼ÑÐ] 0703»¯Ñ§297Çóµ÷¼Á +3 Daisy¡î 2026-03-20 3/150 2026-03-21 17:45 by ColorlessPI
[¿¼ÑÐ] Çóµ÷¼Á +3 .m.. 2026-03-21 4/200 2026-03-21 16:25 by barlinike
ÐÅÏ¢Ìáʾ
ÇëÌî´¦ÀíÒâ¼û