방문자
Scientist. Husband. Daddy. --- TOLLE. LEGE
[1] 이 블로그는 대한민국 저작권법(28조)과 U.S. Copyright Act (17 USC. §107)에 정의된 "저작권물의 공정한 이용원칙 | the U.S. fair use doctrine" 을 따릅니다. [2] 저작권(© 최광민)이 명시된 모든 글과 번역문들에 대해 (1) 원글의 URL 주소링크를 밝히지 않은 모든 형태의 (2) 전문 복제-배포, (3) 임의수정 및 자의적 본문 발췌, (4) 화면캡처 및 배포를 금지합니다. [3] 아울러 이 블로그의 내용을 AI 학습용으로 이용하는 것 역시 금지합니다. [운영] [대문으로] [방명록]
블로그 후원하기
[한국] 하나은행 (최광민): 376-910-500-183-07
[미국] 벤모 Venmo: @pay4kc
[국제] 페이팔 PayPal: @pay4kc
블로그 내부검색
주제
연재
주간 베스트
- [© 최광민] 예수 vs. 예수 #02: 예수는 언제부터 신이었을까?
- [© 최광민] 예수 vs. 예수 #07: 삼위일체 개념은 어디서 유래했을까?
- [© 최광민] 전쟁에 관한 기독교 초기교부들의 견해
- [© 최광민] 예수 vs. 붓다 #1: 소위 "불교계통" 복음서들의 정체: {이사전}, {보병궁 복음서}, {유란시아書}, {임마누엘의 탈무드}
- [© 최광민] 예수 vs. 붓다 #8: 붓다는 어쩌다 예수가 되었을까?
- [© 최광민] 모세 vs. 아케나텐 #1: 소위, {아크나톤 18계명 / 아톤 18계명}의 정체
- [© 최광민] Astroberry OS 3.1 + Ekos 플레이트솔빙 세팅 정리
- [© 최광민] 바울 vs. 바울 #1: 여자의 씨, 아브라함의 씨, 다윗의 씨 - 히브리어 זֶרַע (제라)와 그리스어 σπέρμα (스페르마)의 용례
- [© 최광민] 바울 vs 바울 #2: 바울은 {호세아} 6:2를 임의로 왜곡해 "예수의 3일째 부활" 개념을 유도했을까?
- [© 최광민] 예수 vs. 예수 #03: 콘스탄티누스를 위한 약간의 변호
최신 포스팅
R: mapping values to color palette
Labels:
Informatics
이메일로 전송BlogThis!X에 공유Facebook에서 공유
# value("z") to color vector("output")
# if no zlim, breaks will override
# set color range using seq and colorpanel
val2col<-function(z, zlim, col = heat.colors(12), breaks){
if(!missing(breaks)){
if(length(breaks) != (length(col)+1)){stop("must have one more break than colour")}
}
if(missing(breaks) & !missing(zlim)){
zlim[2] <- zlim[2]+c(zlim[2]-zlim[1])*(1E-3)#adds a bit to the range in both directions
zlim[1] <- zlim[1]-c(zlim[2]-zlim[1])*(1E-3)
breaks <- seq(zlim[1], zlim[2], length.out=(length(col)+1))
}
if(missing(breaks) & missing(zlim)){
zlim <- range(z, na.rm=TRUE)
zlim[2] <- zlim[2]+c(zlim[2]-zlim[1])*(1E-3)#adds a bit to the range in both directions
zlim[1] <- zlim[1]-c(zlim[2]-zlim[1])*(1E-3)
breaks <- seq(zlim[1], zlim[2], length.out=(length(col)+1))
}
CUT <- cut(z, breaks=breaks)
colorlevels <- col[match(CUT, levels(CUT))] # assign colors to heights for each point
return(colorlevels)
}
##
## run val2col
##
library(RColorBrewer)
#rev(brewer.pal(10, "RdYlBu"))
library(gplots)
pairs.breaks = seq(-10, 10, by=0.2)
mycol = colorpanel(n=100,low="blue",mid="white",high="red") # library( gplots )
V(g)$color = val2col( log2(V(g)$fc), col=mycol,breaks=pairs.breaks)
이메일로 전송BlogThis!X에 공유Facebook에서 공유
Labels:
Informatics
Scientist. Husband. Daddy. --- TOLLE. LEGE
[1] This blog complies with the "Fair Use Doctrine" as defined in Article 28 of the Republic of Korea Copyright Act and the U.S. Copyright Act (17 USC. §107). [2] Regarding copyrighted (© Kwangmin Choi) articles and translations, the following actions are prohibited (1) without providing a link to the original URL: (2) Full reproduction and distribution, (3) Unauthorized modification and arbitrary excerpting, and (4) Screen capturing and distribution. [3] Additionally, using the content of this blog for AI training is strictly prohibited. [운영] [대문으로] [방명록]
블로그 후원하기
[한국] 하나은행 (최광민): 376-910-500-183-07
[미국] 벤모 Venmo: @pay4kc
[국제] 페이팔 PayPal: @pay4kc


