²é¿´: 490  |  »Ø¸´: 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µÄ»ØÌû

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µÄ»ØÌû
²é¿´È«²¿ 4 ¸ö»Ø´ð

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µÄ»ØÌû

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µÄ»ØÌû
×î¾ßÈËÆøÈÈÌûÍÆ¼ö [²é¿´È«²¿] ×÷Õß »Ø/¿´ ×îºó·¢±í
[¿¼ÑÐ] Ò»Ö¾Ô¸ÉϺ£½»´óÉúÎïÓëҽҩר˶324·Ö£¬Çóµ÷¼Á +6 jiajunX 2026-03-22 6/300 2026-03-25 23:05 by licg0208
[¿¼ÑÐ] 299Çóµ÷¼Á +4 15188958825 2026-03-25 4/200 2026-03-25 22:56 by 418490947
[¿¼ÑÐ] ×Ü·Ö293Çóµ÷¼Á +4 ¼ÓÒ»Ò»¾Å 2026-03-25 6/300 2026-03-25 22:34 by barlinike
[¿¼ÑÐ] 334·Ö Ò»Ö¾Ô¸ÎäÀí-080500 ²ÄÁÏÇóµ÷¼Á +4 ÀîÀî²»·þÊä 2026-03-25 4/200 2026-03-25 21:26 by ÐÇ¿ÕÐÇÔÂ
[¿¼ÑÐ] Çóµ÷¼Á +3 QiMing7 2026-03-25 3/150 2026-03-25 21:13 by ¸øÄãÄã×¢ÒâÐÝÏ¢
[¿¼ÑÐ] 285Çóµ÷¼Á +3 AZMK 2026-03-24 3/150 2026-03-25 12:23 by userper
[¿¼ÑÐ] ²ÄÁϵ÷¼Á +6 Æ¥¿Ëi 2026-03-23 6/300 2026-03-24 21:09 by greychen00
[¿¼ÑÐ] 306Çó0703µ÷¼ÁÒ»Ö¾Ô¸»ªÖÐʦ·¶ +10 Ö½Óãly 2026-03-21 11/550 2026-03-24 17:22 by qingfeng258
[¿¼ÑÐ] 292Çóµ÷¼Á +4 ¶ì¶ì¶ì¶î¶î¶î¶î¶ 2026-03-24 4/200 2026-03-24 16:41 by peike
[¿¼ÑÐ] 300Çóµ÷¼Á£¬²ÄÁÏ¿ÆÑ§Ó¢Ò»Êý¶þ +5 leaflight 2026-03-24 5/250 2026-03-24 16:25 by laoshidan
[¿¼ÑÐ] 085404µç×ÓÐÅÏ¢284·ÖÇóµ÷¼Á +4 13659058978 2026-03-24 4/200 2026-03-24 12:15 by syl20081243
[¿¼ÑÐ] Çóµ÷¼Á +7 Ê®Èý¼ÓÓÍ 2026-03-21 7/350 2026-03-23 23:48 by ÈÈÇéɳĮ
[¿¼ÑÐ] »·¾³Ñ§Ë¶288Çóµ÷¼Á +8 ƤƤƤ123456 2026-03-22 8/400 2026-03-23 23:47 by ÈÈÇéɳĮ
[¿¼ÑÐ] ²ÄÁÏÓ뻯¹¤085600£¬×Ü·Ö304£¬±¾¿ÆÓÐÁ½Æªsci²ÎÓ룬Çóµ÷¼Á +4 ÐÒÔ˵Ľ´½´ 2026-03-22 5/250 2026-03-22 20:15 by edmund7
[¿¼ÑÐ] 311Çóµ÷¼Á +3 26ÑÐ0 2026-03-20 3/150 2026-03-22 14:46 by ColorlessPI
[¿¼ÑÐ] ³õÊÔ 317 +7 °ëÀ­Ô±û 2026-03-20 7/350 2026-03-21 22:26 by peike
[¿¼ÑÐ] Ò»Ö¾Ô¸¶«»ª´óѧ¿ØÖÆÑ§Ë¶320Çóµ÷¼Á +3 Grand777 2026-03-21 3/150 2026-03-21 19:23 by ¼òÖ®-
[¿¼ÑÐ] 0703»¯Ñ§µ÷¼Á +4 ÄÝÄÝninicgb 2026-03-21 4/200 2026-03-21 18:39 by ѧԱ8dgXkO
[¿¼ÑÐ] 290Çóµ÷¼Á +7 ^O^Ø¿ 2026-03-19 7/350 2026-03-20 21:43 by JourneyLucky
[¿¼ÑÐ] 086500 325 Çóµ÷¼Á +3 Áì´øÐ¡ÐÜ 2026-03-19 3/150 2026-03-20 18:38 by ¾¡Ë´Ò¢1
ÐÅÏ¢Ìáʾ
ÇëÌî´¦ÀíÒâ¼û