Plot 그리기

R에서 한 화면에 두 그래프 찍기

어제 회식하러 가다가 용주형 전화받고 화인한 기능
사실 한 화면에 두개 이상의 plot을 그릴경우가 많이 있고
한눈에 많은 정보를 확인 할 수가 있기 때문에 유용한 기능 중 하나이다.

단 이 명령어로는 양쪽에 서로 다른 값의  y축은 설정 못한다.
-R에서 서로 다른 y축을 가지는 그래프도 그릴 수는 있다. 구글신에게 물어보면 간단히 나올듯... 위에 것도 구굴신에게 물어보니 10분.. ㅎㅎ

>a <- c(1,3,5,7,9,11)
>b <- c(12,10,8,6,4,2)
>plot(a, col="red")
>par(new=TRUE)
>plot(b, col="blue",axes=FALSE)
>dev.print(pdf, file="저장할/파일/경로명/파일명(확장자포함)")

크리에이티브 커먼즈 라이센스
Creative Commons License

Posted by gwlee

2009/10/21 08:34 2009/10/21 08:34
,
Response
0 Trackbacks , 4 Comments
RSS :
http://thegreatgoodplace.com/tt/study/rss/response/258

Trackback URL : http://thegreatgoodplace.com/tt/study/trackback/258

Comments List

  1. odysseus 2009/10/25 18:16 # M/D Reply Permalink

    점도 계속 위에다 찍을 수 있군요.
    어제 라인을 계속 덧그리는건 해봤었는데..ㅋ
    R도 공부하다보니 참 재밌는거 같아요.
    통계 개념을 이해하기 힘들어서 그렇지...ㅎㅎ;;

    1. gwlee 2009/10/25 20:50 # M/D Permalink

      모 예전부터 그랬지만
      공부만큼 재미있는 일은 없는듯합니다.
      요즘 눈물나게 그립슴당.. ㅋㅋ
      2년반이 남았다능.. 킁.. 'ㅅ'

    2. odysseus 2009/10/25 23:34 # M/D Permalink

      이럴 때...참~~~~
      군대 그냥 다녀오길 잘 했단 생각이 마구마구...ㅋㅋㅋ
      난 예비군도 이젠 끝났다는...ㅋ

  2. gwlee 2009/10/28 15:13 # M/D Reply Permalink

    아아악~~~

    미워요~ 흑... ㅠ.ㅜ

    ㅋㅋ

Leave a comment

Library update


#Linux에 ssh로 접속해서 할 경우

>packageStatus()
--원하는 CRAN mirror를 선택한다
  개인적으로 Thukuba를 선택한다.
>update.packages(ask=FALSE)
-패키지 설치시 확인을 안한다., 이거 언제 'y' 누르고 있어..;;

Bioconductor 설치 및 업데이트
>source("http://bioconductor.org/biocLite.R")
>biocLite() //biocLite(groupName="all")
>update.packages(repos=biocinstallRepos(),ask=FALSE)



Monograph 설치 및 업데이트
[Bioinformatics and Computational Biology Solutions Using R and Bioconductor] 의 예제를 하기위해 필요한 Library를 한번에 설치 할 수 있음.
>source("http://bioconductor.org/getMonograph.R")
>getMonograph()


크리에이티브 커먼즈 라이센스
Creative Commons License

Posted by gwlee

2009/03/31 21:27 2009/03/31 21:27
, , , , ,
Response
0 Trackbacks , 0 Comments
RSS :
http://thegreatgoodplace.com/tt/study/rss/response/107

Trackback URL : http://thegreatgoodplace.com/tt/study/trackback/107

Leave a comment
다음과 같은 데이터에서 V1에서  V8과같이 header가 부여된 경우

사용자 삽입 이미지

일단, 보기에 이뿌지 않다!!

고로, V1은 제거 하고,V8에 있는 이름을 V2-V6에 대입하고자한다.
이 방법 말고 좋은 방법이 있을것 같은데.. 흠..

1. V1값을 날리자
d <- d[,-1]

2. V8에 있는 사용할 이름을 name이라는 변수에 저장한다.
name <- t(substr(d[,length(d)],0,9))

3. 변수 x를 이용하여 뒤쪽의 컬럼을 날리자.
x = length(d)-2
d <- d[1:x]
※ d <- d[1:length(d)-2)의 경우 에러가 발생함.

4. names함수를 이용하여 V2-V6의 값을 name값으로 대체
names(d)<-name


사용자 삽입 이미지

크리에이티브 커먼즈 라이센스
Creative Commons License

Posted by gwlee

2009/02/04 05:38 2009/02/04 05:38
Response
0 Trackbacks , 0 Comments
RSS :
http://thegreatgoodplace.com/tt/study/rss/response/71

Trackback URL : http://thegreatgoodplace.com/tt/study/trackback/71

Leave a comment

블로그 이미지

Stay Hungry Stary Foolish!

- gwlee

TC-Cumulus by reznoa requires Flash Player 9 or better.

Site Stats

Total hits:
60664
Today:
26
Yesterday:
48