²é¿´: 492  |  »Ø¸´: 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µÄ»ØÌû
×î¾ßÈËÆøÈÈÌûÍÆ¼ö [²é¿´È«²¿] ×÷Õß »Ø/¿´ ×îºó·¢±í
[¿¼ÑÐ] »¯Ñ§µ÷¼ÁÒ»Ö¾Ô¸ÉϺ£½»Í¨´óѧ336·Ö-±¾¿ÆÉϺ£211 +4 СÓã°®Óлú 2026-03-25 4/200 2026-03-26 10:19 by aa331100
[¿¼ÑÐ] 303Çóµ÷¼Á +6 À¶É½Ô 2026-03-25 6/300 2026-03-25 22:47 by 418490947
[¿¼ÑÐ] 290·Öµ÷¼ÁÇóÖú +3 ¼ªÏéÖ¹Ö¹³Â 2026-03-25 3/150 2026-03-25 19:58 by barlinike
[¿¼ÑÐ] 303Çóµ÷¼Á +6 ԪϦԪ 2026-03-20 7/350 2026-03-25 12:00 by edmund7
[¿¼ÑÐ] 271Çóµ÷¼Á +4 ÉúÈçÏÄ»¨¡­ 2026-03-22 4/200 2026-03-25 11:25 by userper
[¿¼ÑÐ] ²ÄÁÏѧ˶£¬Çóµ÷¼Á 6+4 ÌǺù«888ll 2026-03-22 9/450 2026-03-25 11:19 by greychen00
[¿¼ÑÐ] ¿¼Ñл¯Ñ§308·ÖÇóµ÷¼Á +10 ÄãºÃÃ÷ÌìÄãºÃ 2026-03-23 11/550 2026-03-25 10:23 by userper
[¿¼ÑÐ] 306Çó0703µ÷¼ÁÒ»Ö¾Ô¸»ªÖÐʦ·¶ +10 Ö½Óãly 2026-03-21 11/550 2026-03-24 17:22 by qingfeng258
[¿¼ÑÐ] Çóµ÷¼Á +5 ÁÖ֮Ϧ 2026-03-24 5/250 2026-03-24 17:16 by dick_runner
[¿¼ÑÐ] ²ÄÁÏ¿¼Ñе÷¼ÁÉú +3 »ÆÁ»Ò»ÃÎǧÄê 2026-03-24 3/150 2026-03-24 17:00 by barlinike
[¿¼ÑÐ] 292Çóµ÷¼Á +4 ¶ì¶ì¶ì¶î¶î¶î¶î¶ 2026-03-24 4/200 2026-03-24 16:41 by peike
[¿¼ÑÐ] 305·ÖÇóµ÷¼Á£¨Ê³Æ·¹¤³Ì£© +5 Sxy112 2026-03-21 7/350 2026-03-24 12:27 by 544594351
[¿¼ÑÐ] 085404µç×ÓÐÅÏ¢284·ÖÇóµ÷¼Á +4 13659058978 2026-03-24 4/200 2026-03-24 12:15 by syl20081243
[¿¼ÑÐ] Ò»Ö¾Ô¸ÖÐÄÏ»¯Ñ§£¨0703£©×Ü·Ö337Çóµ÷¼Á +9 niko- 2026-03-19 10/500 2026-03-22 16:08 by ColorlessPI
[¿¼ÑÐ] 324Çóµ÷¼Á +6 luckyѽѽѽѼ 2026-03-20 6/300 2026-03-22 16:01 by ColorlessPI
[¿¼ÑÐ] 0703»¯Ñ§297Çóµ÷¼Á +3 Daisy¡î 2026-03-20 3/150 2026-03-21 17:45 by ColorlessPI
[¿¼ÑÐ] 279Çóµ÷¼Á +5 ºìÒÂÒþ¹Ù 2026-03-21 5/250 2026-03-21 14:59 by lature00
[¿¼ÑÐ] 330Çóµ÷¼Á0854 +3 assdll 2026-03-21 3/150 2026-03-21 13:01 by ²«»÷518
[¿¼ÑÐ] 295²ÄÁÏÇóµ÷¼Á£¬Ò»Ö¾Ô¸Î人Àí¹¤085601ר˶ +5 Charlieyq 2026-03-19 5/250 2026-03-20 20:35 by JourneyLucky
[¿¼ÑÐ] 320Çóµ÷¼Á0856 +3 ²»ÏëÆðÃû×Ö112 2026-03-19 3/150 2026-03-19 22:53 by ѧԱ8dgXkO
ÐÅÏ¢Ìáʾ
ÇëÌî´¦ÀíÒâ¼û