을이용한통계프로그래밍 Jinseog Kim 년 3 월 22 일 1 Assistant Professor, Department of Statistics and Information Science, Dongguk University, Gyeongju, Korea

Size: px
Start display at page:

Download "을이용한통계프로그래밍 Jinseog Kim 년 3 월 22 일 1 Assistant Professor, Department of Statistics and Information Science, Dongguk University, Gyeongju, Korea"

Transcription

1 을이용한통계프로그래밍 Jinseog Kim 년 3 월 22 일 1 Assistant Professor, Department of Statistics and Information Science, Dongguk University, Gyeongju, Korea. jinseog.kim@gmail.com, Homepage: hdatamining.dongguk.ac.kr

2 제 1 장 머리말 본강의노트는처음 R 을접하는학생들에게 R 이어떻게동작하는지, 그리고어떻게 사용하는지를설명하기위하여만들어졌다. R 에서제공하는여러가지기능을사용 하려면, 처음에몇가지의개념들을이해할필요가있는데, 이강의노트에서는학생들 이이해하기쉽도록그개념들에대하여설명할것이다. R 을통계분석및그래픽스을지원하기위하여 Ross Ihaka 과 Robert Gentleman 이 개발하였고, AT&T Bell Lab 에서만든 S 언어에서유래된것으로소프트웨어이면서 프로그래밍언어이다. S 언어에서유래된또다른소프트웨어로는 Insightful 에서상 업용으로만든만든 S-PLUS 1 가있다. R 과 S 는소프트웨어디자인측면에서몇가지 차별성이있는데, 이에대하여는 Ihaka & Gentleman (1996) 2 의논문혹은 R-FAQ 3 를 참조하기바란다. R 은 GNU General Public 라이센스 4 에따라자유롭게사용과배포가가능하며, 현 재 R 의개발과배포는다수의통계학자및개발자들로구성된 R Development Core Team 이주도하고있다. R 은 C 언어와 Fortran 으로이루어진 source 코드혹은 Win Ihaka R. and Gentleman R R: a language for data analysis and graphics. Journal of Computational and Graphical Statistics 5:

3 dows, Linux, 그리고 Macintosh용으로만들어진바이너리코드로배포가되고있고, Comprehensive R Archive Network (CRAN) 인터넷사이트인 org/ 에서구할수있다. R은통계분석뿐만아니라그래프에의한자료의표현을위하여많은함수를제공하는데, 이들그래픽함수를통해서얻어진이미지는다양한형태 (jpg, png, bmp, ps, pdf, emf, pictex, xfig) 로변환하여사용할수있다. 통계분석에관련된함수는스크린에분석결과를보여주기도하고결과를오브젝트의형태혹은파일로저장할수있으며, 이와연결된분석에사용할수도있다. R의프로그래밍언어의기능은사용자가 loop같은기능을사용하여여러개의자료를연속적으로분석하거나, 서로다른분석을위해작성한프로그램들을모아서복잡한분석에이용할수있도록한다. S 언어들은거의대부분 R에서동작하므로 R사용자들은인터넷상에서구할수있는많은 S 코드 5 들을구하여 R에서직접수행할수도있다. R을처음접할경우 R을읽히는데다소어렵다고느껴질수도있지만 R의강점은다른통계소프트웨어와달리매우유연한소프트웨어로알려져있다. 한예로 SAS 나 SPSS와같은전통적인통계분석소프트웨어들이분석결과를화면에출력해주는것과달리 R은결과를오브젝트형태로도저장하여주므로화면에출력된결과없이이오브젝트를가지고다른분석을하는데유용하게활용할수있다. R 초보자들은이점때문에간혹당황하는경우가있지만이런특징은실제로매우유용하며, 사용자들이 R수행의결과물중에서관심이있는필요한부분만발췌하여볼수도있게한다. 예를들어, 20개의회귀분석모형을만들어회귀계수를비교해보고자한다면회귀분석의결과들중회귀계수만을선택하여출력하면된다. 다른전통적인분석소프트웨어에서는이러한결과만을출력하는것이복잡하거나어렵다. 본강의노트가지금은 R이지니는다양한기능들을모두설명하고있지는못하지만, 학생들이 R을학습하는데도움이되기를바라면서, 본강의노트는저자의강의가지속되는한계속업데이트될것이다

4 제 2 장 R 의설치 그림 2.1: R homepage Download the R system from Figure 1 의좌측에있는 CRAN 을클릭 Figure 2-(1) 의우측에다운로드를위한 Mirror 사이트중에서하나를선택 3

5 Figure 2-(2) 의 우측에서 OS 를 선택 (Windows, Linux) Figure 2-(3) 의 우측에서 (Base, contrib) 중 택일, 처음인 경우는 Base 를 선택함 Figure 2-(4) 의 우측에서 가장 최근버전을 다운로드 한다. 통상적으로 윈도우버 젼인 셋업프로그램은 R-버전-win32.exe 라는 명칭으로 되어 있다. 다운로드된 파일을 실행하면 Windows 에 R 이 설치된다. 그림 2.2: R installation 제1절 Rgui R system 의 설치가 끝나면 윈도우즈의 바탕화면에 Rgui 를 실행할 수 있는 아이콘 (Shortcut) 이 생기는데, 이를 클릭하면 R 이 구동이되면서 Figure 2.3 와 같은 윈도가 생긴다. 이를 R-gui 라고 부른다. 4

6 그림 2.3: Rgui 제 2 절 패키지다운로드및설치 R시스템에는기본적으로설치된 package들이있다. 이들기본패키지를확인하려면 R-gui 에서 search() 명령을실행하면된다. > search() [1] ".GlobalEnv" "package:stats" "package:graphics" [4] "package:grdevices" "package:utils" "package:datasets" [7] "package:methods" "Autoloads" "package:base" 이들패키지들이설치된 path를확인하는명령 ( 함수 ) 1 는아래와같다. > searchpaths() [1] ".GlobalEnv" 1 명령과함수를혼용하여사용하는데이후로는함수라고부르겠다 5

7 [2] "C:/PROGRA~1/R/R-25~1.1/library/stats" [3] "C:/PROGRA~1/R/R-25~1.1/library/graphics" [4] "C:/PROGRA~1/R/R-25~1.1/library/grDevices" [5] "C:/PROGRA~1/R/R-25~1.1/library/utils" [6] "C:/PROGRA~1/R/R-25~1.1/library/datasets" [7] "C:/PROGRA~1/R/R-25~1.1/library/methods" [8] "Autoloads" [9] "C:/PROGRA~1/R/R-25~1.1/library/base" R 시스템이 SAS, SPSS 혹은 Splus와같은상용 (commercial) 통계소프트웨어에비하여지니고있는장점중의하나는자료의분석에필요한모듈이매우다양하다는점이다. 이는 R이공개소프트웨어이면서사용자가자신의모듈을쉽게시스템에접목할수있도록하는유연한 API 및제작도구를제공하고있기때문이다. 특정사용자가자체제작한모듈을 R 홈페이지에업로드하면이는모든사용자에게공개되어이를필요로하는일반사용자가다운로드하여사용할수있다. 특정사용자가자체제작한모듈을패키지라고부르며, R-gui는이를다운로드및설치를도와주는도구를제공한다. R-gui의메뉴바의 Packages를선택하고풀다운메뉴에서 Install package를선택하면다운로드사이트 (Figure 2.4 좌측 ) 및다운로드할수있는패키지들이나열된리스트창 (Figure 2.4 우측 ) 이나온다. 이리스트창에서원하는패키지를다운로드할수있다. 이리스트창에는단지패키지이름만나열되어있기때문에패키지의용도는스스로알아봐야한다. 패키지의용도를알아내는방법으로는 R홈페이지에서좌측윈도의 Package를클릭하면 Package list와그용도에대한설명이간략하게나와있으므로참고하기바란다. 아래는품질관리의관리도를그리기위한패키지인 qcc를다운로드하여설치를완료하였을때 R-gui에나타나는메시지이다. 네트워크의사정으로인해서간혹다운로드혹은설치에실패하는경우가있으므로이메시지를반드시확인하기바란다. 6

8 그림 2.4: Install the R contributed package > utils:::menuinstallpkgs() Warning: unable to access index for repository /windows/contrib/2.5 trying URL Content type application/zip length bytes opened URL downloaded 311Kb package qcc successfully unpacked and MD5 sums checked The downloaded packages are in C:\Documents and Settings\star\Local Settings\Temp\RtmpzkpPsb\downloaded_packages 7

9 updating HTML package descriptions 8

10 제 3 장 기본유틸리티 R은사용자의편의를위해서통계분석이외에아래와다양한유틸리티를제공하고있다. 아래는많이이용되는유틸리티에대한설명이다. ls(): 작업공간에있는객체 (objects) 를보여준다. 여기서객체는상수, 데이터프레임, 벡터, 행렬, 함수등 R에서정의된객체들이다. > ls() [1] "BostonHousing" "BostonHousing2" "cvt1" [4] "pred" "resid" "RSS" [7] "spam.p" "spam.t" "t1" [10] "t1.1" rm(): 작업공간에있는객체중에서 () 안에지정한특정객체 (objects) 를삭제한 다. > rm(bostonhousing2, cvt1, t1.1, spam.p) > ls() [1] "BostonHousing" "pred" "resid" "RSS" [5] "spam.t" "t1" 9

11 help(),?: () 안에지정한객체 ( 함수, 데이터 ) 의설명을아래 Figure 3.1 처럼보 여준다. help() 대신? 를사용할수있다. 그림 3.1: Windows help library(): () 안에지정한 package를로드한다. scan(): () 안에지정한외부파일을벡터형태로로드한다. read.table(), read.csv(): () 안에지정한외부파일을데이터프레임형태로로드한다. write.table(), write.csv(): () 안에지정한객체를외부파일로저장한다. save(), save.image(): () 안에지정한객체를 R data형식으로저장한다. x <- runif(20) y <- list(a = 1, b = TRUE, c = "oops") save(x, y, file = "xy.rdata") save.image() load(), unlink(): () 안에지정한 R data 파일을작업환경으로로드하거나, 메 모리에로드했던 Rdata 를 unload 한다. 10

12 load("all.rdata",.globalenv) unlink("all.rdata") sink(): R 코드를실행할때나타나는화면의출력내용을파일로저장려고할 때사용한다. 이경우화면에는출력되지않는다. 파일로저장되던내용을다시 화면으로출력하게하려면 sink() 라고하면된다. zz <- file("all.rout", open="wt") sink(zz) unlink(zz) sink() getwd(): 현재의작업디렉토리를출력해준다. > getwd() [1] "C:/Documents and Settings/jskim/ 바탕화면 / 강의 /statistics seminar(sna)" setwd(dir): 작업디렉토리를 dir 로바꾼다. > setwd("c:/work") > getwd() [1] "c:/work" setwd(dir): 타이틀바에현재작업디렉토리를나타내기. setwindowtitle(paste(":", getwd())) setstatusbar("error occurs") 11

13 제 4 장 객체 (R objects) R objects 에는아래와같은종류들이있고, 기본적으로 R 은 OOP(Object Oriented Programming) 개념에의해설계되었기때문에 R에서사용되는대부분이 object로간주될수있다. atomic ( 상수 ) vector matrix list data.frame function operator... 위의 R 오브젝트의분류중에서 atomic, vector, matrix, data.frame을데이터오브젝트라고부른다. 12

14 제 1 절 Data object 의 storage mode R에서모든데이터오브젝트는 4가지종류의저장타입 (mode or storage mode) 있다.. 아래는데이터오브젝트중 atomic 오브젝트의 4가지 mode에대한예이다. 이러한 4 종류의 mode는 vector, matrix, array 등에공통적으로적용된다. 숫자형 (numeric) > value <- 605 > value [1] 605 문자형 (character) > string <- "Hello World" > string [1] "Hello World" 논리형 (logical) > 2 < 4 [1] TRUE 복소수형 (complex number) > cn < i > cn [1] 2+3i R 에서는데이터의 mode 를확인하는함수로 mode() 가있다. 13

15 > mode(value) [1] "numeric" > mode(string) [1] "character" > mode(2<4) [1] "logical" 데이터오브젝트는 class라는속성을부여할수있는데, 만일데이터오브젝트의 class 속성을따로부여하지않을경우 class속성은데이터의 mode와동일하다. > string <- "Hello World" > mode(string) [1] "character" > class(string) [1] "character" > class(string)<-"myclass" ## string의 class를 "myclass" 로부여 > class(string) [1] "myclass" 제 2 절 vector 벡터는하나이상의원소 (atomic) 로이루어진자료구조이다. 또한벡터를구성하고있는원소 (atomic) 는그형태 (mode) 가동일해야한다. 즉, (1, 2, a, b ) 와같은벡터는있을수가없다. 아래는벡터를생성하는코드이다. x1<-c(1,2,3,4) # 함수 c() 의이용 x2<-1:3 x3<-c("a", "B", "C") y <- c(x1, 0, x2) # 1,2,3,4, 0, 1,2,3 14

16 벡터의길이 (length) 를나타내는함수는 length() 가있다. length(x1) [1] 4 length(x3) [1] 3 length(x3) [1] 4 벡터를생성하는함수로는아래와같은것들이있다. rep(), seq(): # 2를 2번반복 > rep(2, 2) [1] 2 2 # vector (1,2) 의원소를각각 2번반복 > rep(c(1,2), each=2) [1] #0과 1을등구간인 11개숫자로이루어진벡터를만듬 seq(0, 1, length=11) [1] #1에서 9까지 2씩증가하는숫자로이루어진벡터를만듬 seq(1, 9, by = 2) [1] numeric(), double(), integer(), character(): 속성이 numeric, double, integer, 혹은 character 인벡터를괄호안의수만큼할당함 > x<-integer(length = 10) 15

17 > x [1] R 데이터오브젝트중 numeric vector 는다음과같은 class 속성을가질수있다. 이는자료의속성을연속형, 범주형변수로구분하는것과같은맥락으로이해하면 된다. numeric: 연속형 factor: 범주형 ordered: 순서있는범주형 아래의표는모두 numeric vector 인데도불구하고 class 속성이서로다른경우에대한 예시이다. 표 4.1: 벡터오브젝트의 mode 및 class R code mode(x) class(x) x < c(1:10) numeric numeric x< factor(1:10) numeric factor x< ordered(1:10) numeric ordered factor R 데이터오브젝트의 component 를접근하는방법은아래와같이인덱스와 component 이름을이용한다. object [ arg1,..., argn ] object [[ arg1,..., argn ]] object $ tag # for vector, matrix, array # for list # for data.frame or named list 연습문제 16

18 x <- seq(length=51, from=-5, by=.2) y <- rep(x, times=5) z <- rep(x, each=5) 제 3 절 array( 배열 ) 과 matrix( 행렬 ) > Z <- array(data_vector, dim_vector) 예를들어만약 1부터 24까지의수를 3차원배열에넣는방법은아래와같다. > h<-1:24 > Z <- array(h, dim=c(3,4,2)) > Z,, 1 [,1] [,2] [,3] [,4] [1,] [2,] [3,] ,, 2 [,1] [,2] [,3] [,4] [1,] [2,] [3,] 행렬은 2차원배열이므로위와같은방법으로만들수있다. > x <- array(1:20, dim=c(4,5)) [,1] [,2] [,3] [,4] [,5] 17

19 [1,] [2,] [3,] [4,] 또는간단히 matrix() 함수를이용해서아래와같이만들수도있다. X1 <- matrix(1:20, nrow=4, ncol=5) 대각행렬은 diag() 함수를이용하면좀더편하게만들수도있다. X2 <- diag(1, 10) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] [2,] [3,] [4,] [5,] [6,] [7,] [8,] [9,] [10,] X2 <- diag(10) X2 <- diag(1:10) X2 <- diag(c(1,3,5,7,9)) [,1] [,2] [,3] [,4] [,5] [1,] [2,]

20 [3,] [4,] [5,] 행렬의연산 element by element product (A 와 B 가크기가같은행렬일때 ) A * B matrix product( 행렬곱셈 ; A 의열수와 B 의행수가같은경우 ) A %*% B matrix inversion( 역행렬 ; A 가정방행렬인경우 ) A=matrix(c(1,2,3,4), ncol=2) solve(a) [,1] [,2] [1,] [2,] 제 4 절 리스트 (list) List 는그구성요소 (component) 이또다른오브젝트들로이루어진오브젝트이다. 숫 자벡터, 논리값, 행렬, 문자, 배열, 함수등모든 R 오브젝트가리스트의 component 가 될수있다. 19

21 4.0.2 리스트의구성과수정리스트는 list() 함수를이용하여만들수있다. list(name_1=object_1,..., name_m=object_m) 여기서 name_1... name_m 은 [ 이름인수 ] 로리스트의콤포넌트의이름을지정한다. 또한 object_1... 은콤포넌트를위한오브젝트이다. 리스트를만드는간단한예를살펴보자. Lst <- list(name="fred", wife="mary", no.children=3, child.ages=c(4,7,9)) $name [1] "fred" $wife [1] "mary" $no.children [1] 3 $child.ages [1] 만약리스트가 4개의구성요소에대한접근방법은아래와같다. > Lst[[1]] [1] "fred" > Lst[[4]] [1] 리스트의구성요소에이름이붙여져있는경우, 그이름을이용하여접근할수있다. > Lst[["name"]] [1] "fred" > Lst$name 20

22 참고로 Lst[1], Lst[2] 는리스트에서첫번째혹은두번째 component 만으로이루어진서브리스트 (sublist) 를표현한다. > Lst[1] $name [1] "fred" > Lst[3:4] $no.children [1] 3 $child.ages [1] 리스트의콤포넌트의개수는 length() 함수를이용하여구할수있다. > length(lst) => 리스트의결합여러개의리스트는 c() 함수를이용하여연결할수있다. 이를통하여각리스트의구성요소들이차례로결합된형태의새로운리스트가생성된다. list1<-list(a1=1, b1=1:3) list2<-list(a2=2, b2=5:10) list3<-list(a3=3, b3=100:90) list.all <- c(list1, list2, list3) > list.all $a1 [1] 1 $b1 [1]

23 $a2 [1] 2 $b2 [1] $a3 [1] 3 $b3 [1] 제 5 절 데이터프레임 (data frame) 데이터프레임은 data.frame 으로분류되는특별한리스트로서, 리스트에아래의제약을주어만든다. 데이터프레임의구성요소는반드시벡터, 펙터 (factor), 행렬, 리스트또는다른데이터프레임이어야한다. ( 이경우모두데이터프레임이가능하다는말은아님 ) 행렬, 리스트그리고데이터프레임이가진각각의행, 구성요소또는변수는새로운데이터프레임의행, 구성요소또는변수가된다. 벡터 ( 숫자, 문자등 ) 는데이터프레임의하나의열이된다. 데이터프레임에포함된변수는그길이가모두동일해야한다 데이터프레임만들기데이터프레임을만들때는 data.frame() 함수를이용한다. name <-c("kim","lee","park","oh") sex<-c( f, m, f, m ) 22

24 income<-c(100,102,300,204) d1 <- data.frame(name=name, gender=sex, incom=income) > d1 name gender incom 1 kim f lee m park f Oh m 204 리스트나행렬을통째로데이터프레임으로바꾸기위해서는 as.data.frame() 함수를 사용할수있다 데이터프레임관련함수 앞줄보기 head(data) 변수명출력 names(data) 데이터차원출력 nrow(data) # 행 ncol(data) # 열 dim(data) ## 행, 열의차원 (dimension) 23

25 제 5 장 파일에서데이터읽어오기 제 1 절 read.table() 함수 대용량의데이터는 R 콘솔에서키보드를통해읽어들이는것보다는외부파일을통 해서읽어들이는것이편리하다. read.table() 함수는외부파일을읽어데이터프레임을 만들어주는함수이다. 이때외부파일을다음의형식을만족하도록작성할것을권 장한다. 파일의첫번째줄은변수명을지정한다. 다음줄부터는행식별자 ( 행라벨, row labels) 를입력하고그이후에는관측값을 변수명에대응하는순서대로입력한다. 아래는위의형식에의하여작성된외부파일 (houses.data) 의예이다. Price Floor Area Rooms Age Cent.heat no no no no 24

26 yes... 위의예제데이터를불러들여데이터프레임 (HousePrice) 으로만드는 R code는아래와 같다. HousePrice<-read.table("houses.data") 행라벨입력을생략하고싶은경우, 즉외부파일이다음과같이입력된경우어떻 게이를일어들일수있을까? Price Floor Area Rooms Age Cent.heat no no no no yes... 위의경우에는다음과같은코드를이용하면읽어들일수있다. HousePrice <- read.table("houses.data", header=true) 제 2 절 read.csv() 함수 원본데이터를 Excel 파일로편집하는경우다음과같은방식으로 R data.frame 으로 불러들일수있다. as a CSV file (Comma Separated Values). CSV(Comma Separated Values) 형식으로저장 : 파일 Save As: 아래의함수를이용한다. 25

27 my.table=read.csv(file.choose()) ## 대화상자이용 my.table=read.csv("c:/xfile.csv") ## 파일명직접입력 제 3 절 Excel 에서직접읽어오기 Excel 파일을직접읽어데이터프레임으로만들기위해서는 RODBC package를설치하여야한다. library(rodbc); # filename<-paste(path, filename, ".xls", sep=""); channel <- odbcconnectexcel(file.choose()); x<-sqlfetch(channel, "Sheet1"); odbcclose(channel); 제 4 절 scan() 함수 아래와같이텍스트데이터파일 ( input.dat ) 입력되어있다고하자 이러한파일을읽기위해서 scan() 함수를이용한다. inp <- scan("input.dat") 제 5 절 edit() 함수 * 기존의데이터 (olddata) 를수정할때의예 : 26

28 newdata<-edit(olddata) 새로운데이터를편집할때 : xnew<-edit(data.frame()) 27

29 제 6 장 R 오퍼레이터및내장함수 (built-in functions) 제 1 절 R operators - :Minus, can be unary or binary + :Plus, can be unary or binary * :Multiplication, binary / :Division, binary %% :Modulus, binary %/% :Integer division, binary < :Less than, binary > :Greater than, binary == :Equal to, binary >= :Greater than or equal to, binary <= :Less than or equal to, binary! :Unary not 28

30 : :Sequence, binary (in model formulae: interaction) ^ :Exponentiation, binary & :And, binary, vectorized && :And, binary, not vectorized :Or, binary, vectorized :Or, binary, not vectorized <- :Left assignment, binary, <<- :global assignment -> :Right assignment, binary = :Left ssignment, binary $ :List subset, binary 제 2 절 R built-in functions 제곱근지수함수로그함수최대값최소값합평균절대값누적연산삼각함수올림, 반올림... sqrt exp log(5), log2(5), log10(5), log(5, base=3) max, pmax min, pmin sum mean abs cummax, cummin, cumprod, cumsum sin, cos, tan ceiling, round, trunc, floor > sqrt(a) [1]

31 > exp(a) [1] > log(a) [1] > c <- (a + sqrt(a))/(exp(2)+1) > c [1] > x1 <- seq(-2, 4, by =.5) > x1 [1] > floor(x1) [1] > trunc(x1) [1] > a <- c(1,-2,3,-4) > b <- c(-1,2,-3,4) > min(a,b) [1] -4 > pmin(a,b) [1] 제 3 절 Other built-in functions print(): Prints a single R object 30

32 > a<-c(5,3,6,2,4) > print(a) [1] cat(): Prints multiple objects, one after the other > cat("mean of a is ",mean(a), "variance of a is ", var(a),"\n") mean of a is 4 variance of a is 2.5 unique():gives the vector of distinct values x<-c(1,5,1,3,5,7,5) unique(x) [1] diff(): Replace a vector by the vector of first differences > diff(x) [1] sort(): Sort elements into order, but omitting NAs order(): x[order(x)] orders elements of x, with NAs last rev(): reverse the order of vector elements > print(x) [1] > sort(x) [1]

33 > order(x) [1] > rev(x) [1]

34 제 7 장 R 프로그래밍 제 1 절 조건문 조건문에해당되는표현으로는다음의 3 가지종류가있다. if ( cond ) expr if ( cond ) expr1 else expr2 if ( cond1 ) expr1 else if( cond2 ) expr2 else expr3 예 : iris 데이터에서 Sepal.Length의 median을구하고 Sepal.Length를 median보다크면 L, 작으면 S 가되도록하여라. data(iris) n=length(iris$sepal.length) Sepal.Length.Cat = character(n) 33

35 Med=median(iris$Sepal.Length) for(i in 1:n) if(iris$sepal.length<med) Sepal.Length.Cat[i] = "S" else Sepal.Length.Cat[i] = "L"; 제 2 절 순환문 순환문의표현으로는다음세가지표현을사용한다. while ( cond ) expr repeat expr for ( var in list ) expr 위에서 while, repeat, for 구문안에서순환문을끝내기위한구문으로 break와이후의문장을건너뛰고다음순환을하라는구문인 next를사용할수있다. 이는 C 언어에서 break, 그리고 continue 와동일한용도로사용된다. 아래의 R 프로그램은정규분포에서난수 100개를발생시키고이중양수인값들만을합하는프로그램이다. x<-rnorm(100) ## 표준정규분포에서 100개의난수발생 sum.positive <- 0 for(i in 1:100) { if(x[i] < 0) next; sum.positive <- sum.positive + x[i] } 제 3 절 함수의작성 함수작성방법 34

36 function_name <- function(arg_1, arg_2,...){ expression...; return(...) } ( 예제 )mile 을 km 로바꾸는프로그램. miles.to.km <- function(miles) miles*8/5 > miles.to.km(175) # Approximate distance to Sydney, in miles [1] 280 만일 100, miles를 kilometer로바꾼다면 > miles.to.km(c(100,200,300)) [1] 제 4 절 R 에서 C code 부르기 * We will explore using.c and.call with 7 code examples: Using.C /* usec1.c */ /* Calling C with an integer vector using.c */ void usec(int *i) { } i[0] = 11; The C function should be of type void. The compiled code should not return anything except through its arguments. To compile the c code, type at the command prompt: 35

37 R CMD SHLIB usec1.c The compiled code file name is usec1.so In R: > dyn.load("usec1.so") > a <- 1:10 # integer vector > a [1] > out <-.C("useC", b = as.integer(a)) > a [1] > out$b [1] You have to allocate memory to the vectors passed to.c in R by creating vectors of the right length. The first argument to.c is a character string of the C function name. The rest of the arguments are R objects to be passed to the C function. All arguments should be coerced to the correct R storage mode to prevent mismatching of types that can lead to errors..c returns a list object. The second.c argument is given the name b. This name is used for the respective component in the returned list object (but not passed to the compiled code). II. 36

38 /* usec2.c */ /* Calling C with different vector types using.c */ void usec(int *i, double *d, char **c, int *l) { i[0] = 11; d[0] = 2.333; c[1] = "g"; l[0] = 0; } To compile the c code, type at the command prompt: RCMD SHLIB usec2.c to get usec2.so To compile more than one c file: RCMD SHLIB file1.c file2.c file3.c to get file1.so In R: > dyn.load("usec2.so") > i <- 1:10 # integer vector > d <- seq(length=3, from=1, to=2) # real number vector > c <- c("a", "b", "c") # string vector > l <- c("true", "FALSE") # logical vector > i [1] > d 37

39 [1] > c [1] "a" "b" "c" > l [1] "TRUE" "FALSE" > > out <-.C("useC", i1 = as.integer(a), d1 = as.numeric(d), c1 = as.character(c), l1 = as.logical(l)) > out $i1 [1] $d1 [1] $c1 [1] "a" "g" "c" $l1 [1] FALSE FALSE 38

40 제 8 장 R 그래픽스 다른통계분석도구들에비해서 R 이가진장점중의하나가뛰어난그래픽기능이다. 그래프를위한 R 기본함수는아래와같다. 고수준함수 : plot(), barplot(), boxplot(), hist(), pie(), persp() 저수준함수 점그리기 : points() 선그리기 : lines(), abline(), arrows() 문자출력 : text() 도형 : rect(), ploygon() 좌표축 : axis() 격자표현 : grid() x<-rnorm(100, sd=2) y< *x + rnorm(100, sd=1) plot(x) 39

41 그림 8.1: plot() example 제 1 절 barplot() 과 pie plot pie.sales <- c(0.12, 0.3, 0.26, 0.16, 0.04, 0.12) names(pie.sales) <- c("blueberry", "Cherry", "Apple", "Boston Cream", "Other", "Vanilla Cream") barplot(pie.sales) pie(pie.sales) 제 2 절 par() 함수를이용한그래프나누기 x<-rnorm(100) par(mfrow=c(1,2)) hist(x) plot(x) 40

42 Apple Cherry Blueberry Vanilla Cream Other Boston Cream Blueberry Cherry Apple Boston Cream Other Vanilla Cream 그림 8.2: barplot() and pie() examples Histogram of x Frequency x x Index 그림 8.3: par() 함수이용 41

43 제 9 장 R 을이용한기초통계분석 제 1 절 확률분포 (Probability distributions) R에서확률분포와관련된계산을위해서몇가지의함수를제공하고있다. 확률분포와관련된기능으로는누적분포함수 (P (X x)), 확률밀도함수, quantile 함수 (min x {P (X x) > q}), 그리고랜덤넘버의생성이있다. 아래의표 (Table 9.1) 는잘알려진확률분포에대하여 R함수의기본형과입력값들이다. 확률분포와관련된네가지기능을구현하기위해서는위표에나온분포에따른기본형앞에다음과같은접두사를붙이면된다. p : 누적분포함수 (P (X x)) d : 확률밀도함수 (density) q : quantile 함수 (min x {P (X x) > q}) r : 랜덤넘버의생성아래의예제프로그램은 X t(13) 을따를때, P ( X > 2.43) 을구하는것이다. > ## 2-tailed p-value for t distribution 42

44 표 9.1: 확률분포에따른 R 함수의기본형확률분포 R 함수기본형 additional arguments beta beta shape1, shape2, ncp binomial binom size, prob chi-squared chisq df, ncp exponential exp rate F f df1, df2, ncp gamma gamma shape, scale geometric geom prob hypergeometric hyper m, n, k logistic logis location, scale negative binomial nbinom size, prob normal norm mean, sd Poisson pois lambda Student s t t df, ncp uniform unif min, max > 2*pt(-2.43, df = 13) [1] 제 2 절 기초통계 ( 기술통계 ; Descriptive statistics) 일변량자료를분석할때, 맨처음자료의수, 평균, 분산등요약통계량 (summary statistics) 을계산하는것부터시작한다. 이렇게함으로써자료의특징을개략적으로짐작할수있고, 이를바탕으로더세부적인분석을가능하게하기때문이다. 아래는요약통계를구하는함수 summary() 를이용하여기초분석을하는 R코드이다. > attach(faithful) > summary(eruptions) Min. 1st Qu. Median Mean 3rd Qu. Max

45 > fivenum(eruptions) [1] 줄기 - 잎그림과상자그림 > stem(eruptions) The decimal point is 1 digit(s) to the left of the

46 2.2 Histogram A stem-and-leaf plot is like a histogram, and R has a function hist to plot histograms. par(mfrow=c(1,2)) hist(log10(islands)) hist(log10(islands), nclass=15, prob=true) lines(density(log10(islands), bw="sj"), col="blue") rug(log10(islands)) # show the actual data points 그림 9.1: Histogram example The bandwidth bw was chosen by trial-and-error as the default gives too much smoothing. (Better automated methods of bandwidth choice are available, and in this example bw = SJ gives a good result.) 2.3 분포가정의진단 : 정규성검정 표본자료의경험분포함수 (Empirical CDF) 는 ecdf() 함수를이용해서구한다. 45

47 x<-rnorm(200) x2<-runif(200) par(mfrow=c(1,2)) plot(ecdf(x), main="edf of x~norm(0,1)") plot(ecdf(x2), main="edf of x2~uniform(0,1)") 그림 9.2: 경험분포함수 EDF of x~norm(0,1) EDF of x2~uniform(0,1) Fn(x) Fn(x) x x Figure 9.3의좌측그림을보면경험분포가표준적인분포와크게차이가남을알수있다. 따라서자료의값이 3 minutes보다큰것만을골라다시경험분포함수를그리고그위에정규분포의 CDF를도시하였다 (Figure 9.3의우측그림 ). 거의정규분포와비슷하다고보여진다. long <- eruptions[eruptions > 3] plot(ecdf(long), do.points=false, verticals=true) x <- seq(3, 5.4, 0.01) lines(x, pnorm(x, mean=mean(long), sd=sqrt(var(long))), lty=3) 정규성을체크하기위한좀더세밀한시각적인방법은 Quantile-quantile (Q-Q) plot 이다. 46

48 # creating simulated data y <- 4*x+rnorm(100) par(mfrow=c(1,2)) qqnorm(y,main="q-q plot of N(0,1) v.s. Sample(y)") qqline(y) qqplot(qt(ppoints(250), df = 3), y, xlab = "t(3) Quantiles", main="q-q plot of Student-t v.s Sample(y)") qqline(y) 그림 9.3: Q-Q plot Q Q plot of N(0,1) v.s. Sample(y) Q Q plot of Student t v.s Sample(y) Sample Quantiles y Theoretical Quantiles t(3) Quantiles 정규성에대한검토는위와같이그림으로나타내는것이외에정규성검정을통해서도할수있다. R은일변량자료의정규성점정을위하여 Shapiro-Wilk test, Kolmogorov- Smirnov test 등을제공하고있다. > shapiro.test(long) Shapiro-Wilk normality test data: long W = , p-value =

49 > ks.test(long, "pnorm", mean = mean(long), sd = sqrt(var(long))) One-sample Kolmogorov-Smirnov test data: long D = , p-value = alternative hypothesis: two.sided 제 3 절 제 4 절 추정및신뢰구간구하기 two-sample tests 두모집단의평균이같은지를검정하는전통적인방법이이표본 t-test이다. 아래의자료는얼음혼합물의잠재열량 (cal/gm) 을측정한자료이다 (Rice;1995, p.490). Method A: Method B: 먼저두표본의분포를시각적으로비교하기위하여상자그림을그려본다. A <- c( 79.98, 80.04, 80.02, 80.04, 80.03, 80.03, 80.04, 79.97, 80.05, 80.03, 80.02, 80.00, 80.02) B <- c(80.02, 79.94, 79.98, 79.97, 79.97, 80.03, 79.95, 79.97) par(mfrow=c(1,2)) boxplot(list(a=a, B=B)) boxplot(list(a=a, B=B), horizontal = TRUE) 48

50 그림 9.4: Box plot A B A B 위의상자그림을보면첫번째그룹 (A) 에서의열량이두번째그룹 (B) 보다높다고보여진다. 이를두모집단간에평균차가있는지에대한가설검정을통해서확인해보자. R에서 t-test를위한함수는 t.test() 이다. > t.test(a, B) Welch Two Sample t-test data: A and B t = , df = , p-value = alternative hypothesis: true difference in means is not equal to 0 95 percent confidence interval: sample estimates: mean of x mean of y

51 R에서의 t 검정은기본적으로두집단의분산이서로다르다는전제에서수행한다. 두모집단의분산이같은지혹은다른지에대한검정을먼저해야한다. 이경우의검정방법은 F 검정이며, 이를위한 R 함수로는 var.test() 이있다. > var.test(a, B) F test to compare two variances data: A and B F = , num df = 12, denom df = 7, p-value = alternative hypothesis: true ratio of variances is not equal to 1 95 percent confidence interval: sample estimates: ratio of variances F-검정결과두모집단의분산이다르다고할만한근거는없다고판단된다. 따라서분산이동일한경우에대한 t-test를다음과같이한다. > t.test(a, B, var.equal=true) Two Sample t-test data: A and B t = , df = 19, p-value = alternative hypothesis: true difference in means is not equal to 0 95 percent confidence interval:

52 sample estimates: mean of x mean of y 위의모든 t 검정은기본적으로두표본이정규분포를따른다는가정에서출발한다. 따라서정규성을만족하는지를체크하여야한다. 정규성에대한진단은앞소절 (2.3) 에서처럼시각적인방법혹은가설검정을통해서할수있다. > plot(ecdf(a), do.points=false, verticals=true, xlim=range(a, B)) > plot(ecdf(b), do.points=false, verticals=true, add=true) 다음은두분포가서로동일한지를검정하는 Kolmogorov-Smirnov test 이다. > ks.test(a, B) Two-sample Kolmogorov-Smirnov test data: A and B D = , p-value = alternative hypothesis: two-sided Warning message: cannot compute correct p-values with ties in: ks.test(a, B) 제 5 절 대응비교 (paired t-test) 이변량자료에대한대응비교 (paired t-test) 역시 t.test() 함수를이용한다. 다만, R 함수 t.test() 에는아래와같은많은인수들이있으며, 이함수의인수중에 paired=true 로지정하기만하면된다. t.test(x, y = NULL, 51

53 alternative = c("two.sided", "less", "greater"), mu = 0, paired = FALSE, var.equal = FALSE, conf.level = 0.95,...) 제 6 절 비율검정및카이제곱검정 smokers <- c( 83, 90, 129, 70 ) patients <- c( 86, 93, 136, 82 ) prop.test(smokers, patients) ## Effect of simulating p-values x <- matrix(c(12, 5, 7, 7), nc = 2) chisq.test(x)$p.value # chisq.test(x, simulate.p.value = TRUE, B = 10000)$p.value # around 0.29! 52

R-1: R intro. & Objects

R-1: R intro. & Objects 데이터사이언티스트를위한 R-1: R intro. & Objects Jinseog Kim Dongguk University jinseog.kim@gmail.com 2017-03-14 inseog KimDongguk Universityjinseog.kim@gmail.com 데이터사이언티스트를위한 R-1: R intro. & Objects 2017-03-14 1

More information

R t-..

R t-.. R 과데이터분석 집단의차이비교 t- 검정 양창모 청주교육대학교컴퓨터교육과 2015 년겨울 t- 검정 변수의값이연속적이고정규분포를따른다고할때사용 t.test() 는모평균과모평균의 95% 신뢰구간을추청함과동시에가설검증을수행한다. 모평균의구간추정 - 일표본 t- 검정 이가설검정의귀무가설은 모평균이 0 이다 라는귀무가설이다. > x t.test(x)

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 Lec. 2 : Introduction to R Part 2 Big Data Analytics Short Course 17. 07. 04 R 의데이터구조 : Factor factor() : factor 생성하기 > region = c("a","a","b","c","d") > region [1] "A" "A" "B" "C" "D" > class(region)

More information

C# Programming Guide - Types

C# Programming Guide - Types C# Programming Guide - Types 최도경 lifeisforu@wemade.com 이문서는 MSDN 의 Types 를요약하고보충한것입니다. http://msdn.microsoft.com/enus/library/ms173104(v=vs.100).aspx Types, Variables, and Values C# 은 type 에민감한언어이다. 모든

More information

Microsoft Word - SAS_Data Manipulate.docx

Microsoft Word - SAS_Data Manipulate.docx 수학계산관련 함수 함수 형태 내용 SIN(argument) TAN(argument) EXP( 변수명 ) SIN 값을계산 -1 argument 1 TAN 값을계산, -1 argument 1 지수함수로지수값을계산한다 SQRT( 변수명 ) 제곱근값을계산한다 제곱은 x**(1/3) = 3 x x 1/ 3 x**2, 세제곱근 LOG( 변수명 ) LOGN( 변수명 )

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 System Software Experiment 1 Lecture 5 - Array Spring 2019 Hwansoo Han (hhan@skku.edu) Advanced Research on Compilers and Systems, ARCS LAB Sungkyunkwan University http://arcs.skku.edu/ 1 배열 (Array) 동일한타입의데이터가여러개저장되어있는저장장소

More information

chap10.PDF

chap10.PDF 10 C++ Hello!! C C C++ C++ C++ 2 C++ 1980 Bell Bjarne Stroustrup C++ C C++ C, C++ C C 3 C C++ (prototype) (type checking) C C++ : C++ 4 C C++ (prototype) (type checking) [ 10-1] #include extern

More information

Microsoft PowerPoint - chap02-C프로그램시작하기.pptx

Microsoft PowerPoint - chap02-C프로그램시작하기.pptx #include int main(void) { int num; printf( Please enter an integer "); scanf("%d", &num); if ( num < 0 ) printf("is negative.\n"); printf("num = %d\n", num); return 0; } 1 학습목표 을 작성하면서 C 프로그램의

More information

예제 1.1 ( 관계연산자 ) >> A=1:9, B=9-A A = B = >> tf = A>4 % 4 보다큰 A 의원소들을찾을경우 tf = >> tf = (A==B) % A

예제 1.1 ( 관계연산자 ) >> A=1:9, B=9-A A = B = >> tf = A>4 % 4 보다큰 A 의원소들을찾을경우 tf = >> tf = (A==B) % A 예제 1.1 ( 관계연산자 ) >> A=1:9, B=9-A A = 1 2 3 4 5 6 7 8 9 B = 8 7 6 5 4 3 2 1 0 >> tf = A>4 % 4 보다큰 A 의원소들을찾을경우 tf = 0 0 0 0 1 1 1 1 1 >> tf = (A==B) % A 의원소와 B 의원소가똑같은경우를찾을때 tf = 0 0 0 0 0 0 0 0 0 >> tf

More information

확률 및 분포

확률 및 분포 확률및분포 박창이 서울시립대학교통계학과 박창이 ( 서울시립대학교통계학과 ) 확률및분포 1 / 15 학습내용 조건부확률막대그래프히스토그램선그래프산점도참고 박창이 ( 서울시립대학교통계학과 ) 확률및분포 2 / 15 조건부확률 I 첫째가딸일때두아이모두딸일확률 (1/2) 과둘중의하나가딸일때둘다딸일확률 (1/3) 에대한모의실험 >>> from collections import

More information

MySQL-.. 1

MySQL-.. 1 MySQL- 기초 1 Jinseog Kim Dongguk University jinseog.kim@gmail.com 2017-08-25 Jinseog Kim Dongguk University jinseog.kim@gmail.com MySQL-기초 1 2017-08-25 1 / 18 SQL의 기초 SQL은 아래의 용도로 구성됨 데이터정의 언어(Data definition

More information

Microsoft PowerPoint - Java7.pptx

Microsoft PowerPoint - Java7.pptx HPC & OT Lab. 1 HPC & OT Lab. 2 실습 7 주차 Jin-Ho, Jang M.S. Hanyang Univ. HPC&OT Lab. jinhoyo@nate.com HPC & OT Lab. 3 Component Structure 객체 (object) 생성개념을이해한다. 외부클래스에대한접근방법을이해한다. 접근제어자 (public & private)

More information

R R ...

R R ... R과 데이터분석 R 데이터 양창모 청주교육대학교 컴퓨터교육과 2015년 겨울 R에서 지원하는 데이터 타입 I R에서는 일반적인 프로그래밍 언어에서 흔히 사용되는 정수, 부동소수, 문자열이 기본적으로 지원된다. I 그외에도 자료처리에 적합한 자료구조인 벡터vector, 행렬matrix, 데이터 프레임data frame, 리스트list 등이 있다. R에서 지원하는

More information

C++-¿Ïº®Çؼ³10Àå

C++-¿Ïº®Çؼ³10Àå C C++. (preprocessor directives), C C++ C/C++... C++, C. C++ C. C C++. C,, C++, C++., C++.,.. #define #elif #else #error #if #itdef #ifndef #include #line #pragma #undef #.,.,. #include #include

More information

비트와바이트 비트와바이트 비트 (Bit) : 2진수값하나 (0 또는 1) 를저장할수있는최소메모리공간 1비트 2비트 3비트... n비트 2^1 = 2개 2^2 = 4개 2^3 = 8개... 2^n 개 1 바이트는 8 비트 2 2

비트와바이트 비트와바이트 비트 (Bit) : 2진수값하나 (0 또는 1) 를저장할수있는최소메모리공간 1비트 2비트 3비트... n비트 2^1 = 2개 2^2 = 4개 2^3 = 8개... 2^n 개 1 바이트는 8 비트 2 2 비트연산자 1 1 비트와바이트 비트와바이트 비트 (Bit) : 2진수값하나 (0 또는 1) 를저장할수있는최소메모리공간 1비트 2비트 3비트... n비트 2^1 = 2개 2^2 = 4개 2^3 = 8개... 2^n 개 1 바이트는 8 비트 2 2 진수법! 2, 10, 16, 8! 2 : 0~1 ( )! 10 : 0~9 ( )! 16 : 0~9, 9 a, b,

More information

chap 5: Trees

chap 5: Trees 5. Threaded Binary Tree 기본개념 n 개의노드를갖는이진트리에는 2n 개의링크가존재 2n 개의링크중에 n + 1 개의링크값은 null Null 링크를다른노드에대한포인터로대체 Threads Thread 의이용 ptr left_child = NULL 일경우, ptr left_child 를 ptr 의 inorder predecessor 를가리키도록변경

More information

Microsoft PowerPoint - ch07 - 포인터 pm0415

Microsoft PowerPoint - ch07 - 포인터 pm0415 2015-1 프로그래밍언어 7. 포인터 (Pointer), 동적메모리할당 2015 년 4 월 4 일 교수김영탁 영남대학교공과대학정보통신공학과 (Tel : +82-53-810-2497; Fax : +82-53-810-4742 http://antl.yu.ac.kr/; E-mail : ytkim@yu.ac.kr) Outline 포인터 (pointer) 란? 간접참조연산자

More information

(Exposure) Exposure (Exposure Assesment) EMF Unknown to mechanism Health Effect (Effect) Unknown to mechanism Behavior pattern (Micro- Environment) Re

(Exposure) Exposure (Exposure Assesment) EMF Unknown to mechanism Health Effect (Effect) Unknown to mechanism Behavior pattern (Micro- Environment) Re EMF Health Effect 2003 10 20 21-29 2-10 - - ( ) area spot measurement - - 1 (Exposure) Exposure (Exposure Assesment) EMF Unknown to mechanism Health Effect (Effect) Unknown to mechanism Behavior pattern

More information

JAVA 프로그래밍실습 실습 1) 실습목표 - 메소드개념이해하기 - 매개변수이해하기 - 새메소드만들기 - Math 클래스의기존메소드이용하기 ( ) 문제 - 직사각형모양의땅이있다. 이땅의둘레, 면적과대각

JAVA 프로그래밍실습 실습 1) 실습목표 - 메소드개념이해하기 - 매개변수이해하기 - 새메소드만들기 - Math 클래스의기존메소드이용하기 (   ) 문제 - 직사각형모양의땅이있다. 이땅의둘레, 면적과대각 JAVA 프로그래밍실습 실습 1) 실습목표 - 메소드개념이해하기 - 매개변수이해하기 - 새메소드만들기 - Math 클래스의기존메소드이용하기 ( http://java.sun.com/javase/6/docs/api ) 문제 - 직사각형모양의땅이있다. 이땅의둘레, 면적과대각선의길이를계산하는메소드들을작성하라. 직사각형의가로와세로의길이는주어진다. 대각선의길이는 Math클래스의적절한메소드를이용하여구하라.

More information

C 프로그래밍 언어 입문 C 프로그래밍 언어 입문 김명호저 숭실대학교 출판국 머리말..... C, C++, Java, Fortran, Python, Ruby,.. C. C 1972. 40 C.. C. 1999 C99. C99. C. C. C., kmh ssu.ac.kr.. ,. 2013 12 Contents 1장 프로그래밍 시작 1.1 C 10 1.2 12

More information

확률과통계6

확률과통계6 확률과통계 6. 이산형확률분포 건국대학교스마트 ICT 융합공학과윤경로 (yoonk@konkuk.ac.kr) 6. 이산형확률분포 6.1 이산균일분포 6.2 이항분포 6.3 초기하분포 6.4 포아송분포 6.5 기하분포 6.6 음이항분포 * ( 제외 ) 6.7 다항분포 * ( 제외 ) 6.1 이산균일분포 [ 정의 6-1] 이산균일분포 (discrete uniform

More information

G Power

G Power G Power 부산대학교통계학과조영석 1. G Power 란? 2. G Power 설치및실행 2.1 G Power 설치 2.2 G Power 실행 3. 검정 (Test) 3.1 가설검정 (Test of hypothesis) 3.2 검정력 (Power) 3.3 효과크기 (Effect size) 3.4 표본수산정 4. 분석 4.1 t- 검정 (t-test) 4.2

More information

PowerPoint Template

PowerPoint Template JavaScript 회원정보 입력양식만들기 HTML & JavaScript Contents 1. Form 객체 2. 일반적인입력양식 3. 선택입력양식 4. 회원정보입력양식만들기 2 Form 객체 Form 객체 입력양식의틀이되는 태그에접근할수있도록지원 Document 객체의하위에위치 속성들은모두 태그의속성들의정보에관련된것

More information

untitled

untitled 5.8 PROC UNIVARIATE (hitogram, tem and leaf plot, box-whiker plot), (p- ). Univariate( ).. NORMAL (Shapiro- Wilk Kolmogorov-Smirno D- OUTPUT( SAS ). PROC MEANS PROC MEANS. (moment) E( X ). k Sehyug Kwon,

More information

R

R R 프로그래밍의기초 Big Data Analytics Short Courses 5 Big Data Analytics Short Courses R 프로그래밍의기초 5 1 / 37 R Programming 1 R Programming 2 3 Big Data Analytics Short Courses R 프로그래밍의기초 5 2 / 37 Topic R Programming

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 @ Lesson 2... ( ). ( ). @ vs. logic data method variable behavior attribute method field Flow (Type), ( ) member @ () : C program Method A ( ) Method B ( ) Method C () program : Java, C++, C# data @ Program

More information

Columns 8 through while expression {commands} 예제 1.2 (While 반복문의이용 ) >> num=0

Columns 8 through while expression {commands} 예제 1.2 (While 반복문의이용 ) >> num=0 for loop array {commands} 예제 1.1 (For 반복변수의이용 ) >> data=[3 9 45 6; 7 16-1 5] data = 3 9 45 6 7 16-1 5 >> for n=data x=n(1)-n(2) -4-7 46 1 >> for n=1:10 x(n)=sin(n*pi/10); n=10; >> x Columns 1 through 7

More information

2002년 2학기 자료구조

2002년 2학기 자료구조 자료구조 (Data Structures) Chapter 1 Basic Concepts Overview : Data (1) Data vs Information (2) Data Linear list( 선형리스트 ) - Sequential list : - Linked list : Nonlinear list( 비선형리스트 ) - Tree : - Graph : (3)

More information

untitled

untitled R&S Power Viewer Plus For NRP Sensor 1.... 3 2....5 3....6 4. R&S NRP...7 -.7 - PC..7 - R&S NRP-Z4...8 - R&S NRP-Z3... 8 5. Rohde & Schwarz 10 6. R&S Power Viewer Plus.. 11 6.1...12 6.2....13 - File Menu...

More information

DocsPin_Korean.pages

DocsPin_Korean.pages Unity Localize Script Service, Page 1 Unity Localize Script Service Introduction Application Game. Unity. Google Drive Unity.. Application Game. -? ( ) -? -?.. 준비사항 Google Drive. Google Drive.,.. - Google

More information

슬라이드 1

슬라이드 1 Pairwise Tool & Pairwise Test NuSRS 200511305 김성규 200511306 김성훈 200614164 김효석 200611124 유성배 200518036 곡진화 2 PICT Pairwise Tool - PICT Microsoft 의 Command-line 기반의 Free Software www.pairwise.org 에서다운로드후설치

More information

1

1 1 1....6 1.1...6 2. Java Architecture...7 2.1 2SDK(Software Development Kit)...8 2.2 JRE(Java Runtime Environment)...9 2.3 (Java Virtual Machine, JVM)...10 2.4 JVM...11 2.5 (runtime)jvm...12 2.5.1 2.5.2

More information

휠세미나3 ver0.4

휠세미나3 ver0.4 andromeda@sparcs:/$ ls -al dev/sda* brw-rw---- 1 root disk 8, 0 2014-06-09 18:43 dev/sda brw-rw---- 1 root disk 8, 1 2014-06-09 18:43 dev/sda1 brw-rw---- 1 root disk 8, 2 2014-06-09 18:43 dev/sda2 andromeda@sparcs:/$

More information

Microsoft PowerPoint - ch10 - 이진트리, AVL 트리, 트리 응용 pm0600

Microsoft PowerPoint - ch10 - 이진트리, AVL 트리, 트리 응용 pm0600 균형이진탐색트리 -VL Tree delson, Velskii, Landis에의해 1962년에제안됨 VL trees are balanced n VL Tree is a binary search tree such that for every internal node v of T, the heights of the children of v can differ by at

More information

PowerPoint Presentation

PowerPoint Presentation Package Class 3 Heeseung Jo 목차 section 1 패키지개요와패키지의사용 section 2 java.lang 패키지의개요 section 3 Object 클래스 section 4 포장 (Wrapper) 클래스 section 5 문자열의개요 section 6 String 클래스 section 7 StringBuffer 클래스 section

More information

4. #include <stdio.h> #include <stdlib.h> int main() { functiona(); } void functiona() { printf("hihi\n"); } warning: conflicting types for functiona

4. #include <stdio.h> #include <stdlib.h> int main() { functiona(); } void functiona() { printf(hihi\n); } warning: conflicting types for functiona 이름 : 학번 : A. True or False: 각각항목마다 True 인지 False 인지적으세요. 1. (Python:) randint 함수를사용하려면, random 모듈을 import 해야한다. 2. (Python:) '' (single quote) 는한글자를표현할때, (double quote) 는문자열을표현할때사용한다. B. 다음에러를수정하는방법을적으세요.

More information

adfasdfasfdasfasfadf

adfasdfasfdasfasfadf C 4.5 Source code Pt.3 ISL / 강한솔 2019-04-10 Index Tree structure Build.h Tree.h St-thresh.h 2 Tree structure *Concpets : Node, Branch, Leaf, Subtree, Attribute, Attribute Value, Class Play, Don't Play.

More information

DE1-SoC Board

DE1-SoC Board 실습 1 개발환경 DE1-SoC Board Design Tools - Installation Download & Install Quartus Prime Lite Edition http://www.altera.com/ Quartus Prime (includes Nios II EDS) Nios II Embedded Design Suite (EDS) is automatically

More information

Tcl의 문법

Tcl의 문법 월, 01/28/2008-20:50 admin 은 상당히 단순하고, 커맨드의 인자를 스페이스(공백)로 단락을 짓고 나열하는 정도입니다. command arg1 arg2 arg3... 한행에 여러개의 커맨드를 나열할때는, 세미콜론( ; )으로 구분을 짓습니다. command arg1 arg2 arg3... ; command arg1 arg2 arg3... 한행이

More information

컴파일러

컴파일러 YACC 응용예 Desktop Calculator 7/23 Lex 입력 수식문법을위한 lex 입력 : calc.l %{ #include calc.tab.h" %} %% [0-9]+ return(number) [ \t] \n return(0) \+ return('+') \* return('*'). { printf("'%c': illegal character\n",

More information

untitled

untitled int i = 10; char c = 69; float f = 12.3; int i = 10; char c = 69; float f = 12.3; printf("i : %u\n", &i); // i printf("c : %u\n", &c); // c printf("f : %u\n", &f); // f return 0; i : 1245024 c : 1245015

More information

01-OOPConcepts(2).PDF

01-OOPConcepts(2).PDF Object-Oriented Programming Concepts Tel: 02-824-5768 E-mail: hhcho@selabsoongsilackr? OOP (Object) (Encapsulation) (Message) (Class) (Inheritance) (Polymorphism) (Abstract Class) (Interface) 2 1 + = (Dependency)

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 Reasons for Poor Performance Programs 60% Design 20% System 2.5% Database 17.5% Source: ORACLE Performance Tuning 1 SMS TOOL DBA Monitoring TOOL Administration TOOL Performance Insight Backup SQL TUNING

More information

Secure Programming Lecture1 : Introduction

Secure Programming Lecture1 : Introduction Malware and Vulnerability Analysis Lecture3-2 Malware Analysis #3-2 Agenda 안드로이드악성코드분석 악성코드분석 안드로이드악성코드정적분석 APK 추출 #1 adb 명령 안드로이드에설치된패키지리스트추출 adb shell pm list packages v0nui-macbook-pro-2:lecture3 v0n$

More information

쉽게 풀어쓴 C 프로그래밍

쉽게 풀어쓴 C 프로그래밍 제 3 장함수와문자열 1. 함수의기본적인개념을이해한다. 2. 인수와매개변수의개념을이해한다. 3. 함수의인수전달방법 2가지를이해한다 4. 중복함수를이해한다. 5. 디폴트매개변수를이해한다. 6. 문자열의구성을이해한다. 7. string 클래스의사용법을익힌다. 이번장에서만들어볼프로그램 함수란? 함수선언 함수호출 예제 #include using

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 @ Lesson 3 if, if else, if else if, switch case for, while, do while break, continue : System.in, args, JOptionPane for (,, ) @ vs. logic data method variable Data Data Flow (Type), ( ) @ Member field

More information

Microsoft PowerPoint - e pptx

Microsoft PowerPoint - e pptx Import/Export Data Using VBA Objectives Referencing Excel Cells in VBA Importing Data from Excel to VBA Using VBA to Modify Contents of Cells 새서브프로시저작성하기 프로시저실행하고결과확인하기 VBA 코드이해하기 Referencing Excel Cells

More information

Buy one get one with discount promotional strategy

Buy one get one with discount promotional strategy Buy one get one with discount Promotional Strategy Kyong-Kuk Kim, Chi-Ghun Lee and Sunggyun Park ISysE Department, FEG 002079 Contents Introduction Literature Review Model Solution Further research 2 ISysE

More information

강의10

강의10 Computer Programming gdb and awk 12 th Lecture 김현철컴퓨터공학부서울대학교 순서 C Compiler and Linker 보충 Static vs Shared Libraries ( 계속 ) gdb awk Q&A Shared vs Static Libraries ( 계속 ) Advantage of Using Libraries Reduced

More information

에너지경제연구 Korean Energy Economic Review Volume 17, Number 2, September 2018 : pp. 1~29 정책 용도별특성을고려한도시가스수요함수의 추정 :, ARDL,,, C4, Q4-1 -

에너지경제연구 Korean Energy Economic Review Volume 17, Number 2, September 2018 : pp. 1~29 정책 용도별특성을고려한도시가스수요함수의 추정 :, ARDL,,, C4, Q4-1 - 에너지경제연구 Korean Energy Economic Review Volume 17, Number 2, September 2018 : pp. 1~29 정책 용도별특성을고려한도시가스수요함수의 추정 :, ARDL,,, C4, Q4-1 - . - 2 - . 1. - 3 - [ 그림 1] 도시가스수요와실질 GDP 추이 - 4 - - 5 - - 6 - < 표 1>

More information

Analytics > Log & Crash Search > Unity ios SDK [Deprecated] Log & Crash Unity ios SDK. TOAST SDK. Log & Crash Unity SDK Log & Crash Search. Log & Cras

Analytics > Log & Crash Search > Unity ios SDK [Deprecated] Log & Crash Unity ios SDK. TOAST SDK. Log & Crash Unity SDK Log & Crash Search. Log & Cras Analytics > Log & Crash Search > Unity ios SDK [Deprecated] Log & Crash Unity ios SDK. TOAST SDK. Log & Crash Unity SDK Log & Crash Search. Log & Crash Unity SDK... Log & Crash Search. - Unity3D v4.0 ios

More information

Microsoft PowerPoint - 기계공학실험1-1MATLAB_개요2D.pptx

Microsoft PowerPoint - 기계공학실험1-1MATLAB_개요2D.pptx 1. MATLAB 개요와 활용 기계공학실험 I 2013년 2학기 MATLAB 시작하기 이장의내용 MATLAB의여러창(window)들의 특성과 목적 기술 스칼라의 산술연산 및 기본 수학함수의 사용. 스칼라 변수들(할당 연산자)의 정의 및 변수들의 사용 방법 스크립트(script) 파일에 대한 소개와 간단한 MATLAB 프로그램의 작성, 저장 및 실행 MATLAB의특징

More information

Week5

Week5 Week 05 Iterators, More Methods and Classes Hash, Regex, File I/O Joonhwan Lee human-computer interaction + design lab. Iterators Writing Methods Classes & Objects Hash File I/O Quiz 4 1. Iterators Array

More information

Microsoft PowerPoint - ch09 - 연결형리스트, Stack, Queue와 응용 pm0100

Microsoft PowerPoint - ch09 - 연결형리스트, Stack, Queue와 응용 pm0100 2015-1 프로그래밍언어 9. 연결형리스트, Stack, Queue 2015 년 5 월 4 일 교수김영탁 영남대학교공과대학정보통신공학과 (Tel : +82-53-810-2497; Fax : +82-53-810-4742 http://antl.yu.ac.kr/; E-mail : ytkim@yu.ac.kr) 연결리스트 (Linked List) 연결리스트연산 Stack

More information

public key private key Encryption Algorithm Decryption Algorithm 1

public key private key Encryption Algorithm Decryption Algorithm 1 public key private key Encryption Algorithm Decryption Algorithm 1 One-Way Function ( ) A function which is easy to compute in one direction, but difficult to invert - given x, y = f(x) is easy - given

More information

Chap 6: Graphs

Chap 6: Graphs 그래프표현법 인접행렬 (Adjacency Matrix) 인접리스트 (Adjacency List) 인접다중리스트 (Adjacency Multilist) 6 장. 그래프 (Page ) 인접행렬 (Adjacency Matrix) n 개의 vertex 를갖는그래프 G 의인접행렬의구성 A[n][n] (u, v) E(G) 이면, A[u][v] = Otherwise, A[u][v]

More information

제 14 장포인터활용 유준범 (JUNBEOM YOO) Ver 본강의자료는생능출판사의 PPT 강의자료 를기반으로제작되었습니다.

제 14 장포인터활용 유준범 (JUNBEOM YOO) Ver 본강의자료는생능출판사의 PPT 강의자료 를기반으로제작되었습니다. 제 14 장포인터활용 유준범 (JUNBEOM YOO) Ver. 2.0 jbyoo@konkuk.ac.kr http://dslab.konkuk.ac.kr 본강의자료는생능출판사의 PPT 강의자료 를기반으로제작되었습니다. 이번장에서학습할내용 이중포인터란무엇인가? 포인터배열 함수포인터 다차원배열과포인터 void 포인터 포인터는다양한용도로유용하게활용될수있습니다. 2 이중포인터

More information

012임수진

012임수진 Received : 2012. 11. 27 Reviewed : 2012. 12. 10 Accepted : 2012. 12. 12 A Clinical Study on Effect of Electro-acupuncture Treatment for Low Back Pain and Radicular Pain in Patients Diagnosed with Lumbar

More information

Interstage5 SOAP서비스 설정 가이드

Interstage5 SOAP서비스 설정 가이드 Interstage 5 Application Server ( Solaris ) SOAP Service Internet Sample Test SOAP Server Application SOAP Client Application CORBA/SOAP Server Gateway CORBA/SOAP Gateway Client INTERSTAGE SOAP Service

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 How to produce ChemML and MathML 조윤상 ( 과편협기획운영위원 ) 1 Applications of XML Applications of XML RDF (Resource Description Framework) : 자원의정보를표현하기위한규격, 구문및구조에대한공통적인규칙을지원. RSS (Rich Site Summary) : 뉴스나블로그사이트에서주로사용하는콘텐츠표현방식.

More information

thesis

thesis ( Design and Implementation of a Generalized Management Information Repository Service for Network and System Management ) ssp@nile nile.postech.ac..ac.kr DPE Lab. 1997 12 16 GMIRS GMIRS GMIRS prototype

More information

< E20C6DFBFFEBEEE20C0DBBCBAC0BB20C0A7C7D12043BEF0BEEE20492E707074>

< E20C6DFBFFEBEEE20C0DBBCBAC0BB20C0A7C7D12043BEF0BEEE20492E707074> Chap #2 펌웨어작성을위한 C 언어 I http://www.smartdisplay.co.kr 강의계획 Chap1. 강의계획및디지털논리이론 Chap2. 펌웨어작성을위한 C 언어 I Chap3. 펌웨어작성을위한 C 언어 II Chap4. AT89S52 메모리구조 Chap5. SD-52 보드구성과코드메모리프로그래밍방법 Chap6. 어드레스디코딩 ( 매핑 ) 과어셈블리어코딩방법

More information

Microsoft PowerPoint - chap-11.pptx

Microsoft PowerPoint - chap-11.pptx 쉽게풀어쓴 C 언어 Express 제 11 장포인터 컴퓨터프로그래밍기초 이번장에서학습할내용 포인터이란? 변수의주소 포인터의선언 간접참조연산자 포인터연산 포인터와배열 포인터와함수 이번장에서는포인터의기초적인지식을학습한다. 컴퓨터프로그래밍기초 2 포인터란? 포인터 (pointer): 주소를가지고있는변수 컴퓨터프로그래밍기초 3 메모리의구조 변수는메모리에저장된다. 메모리는바이트단위로액세스된다.

More information

6자료집최종(6.8))

6자료집최종(6.8)) Chapter 1 05 Chapter 2 51 Chapter 3 99 Chapter 4 151 Chapter 1 Chapter 6 7 Chapter 8 9 Chapter 10 11 Chapter 12 13 Chapter 14 15 Chapter 16 17 Chapter 18 Chapter 19 Chapter 20 21 Chapter 22 23 Chapter

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 실습 1 배효철 th1g@nate.com 1 목차 조건문 반복문 System.out 구구단 모양만들기 Up & Down 2 조건문 조건문의종류 If, switch If 문 조건식결과따라중괄호 { 블록을실행할지여부결정할때사용 조건식 true 또는 false값을산출할수있는연산식 boolean 변수 조건식이 true이면블록실행하고 false 이면블록실행하지않음 3

More information

Microsoft Word - [2017SMA][T8]OOPT_Stage_2040 ver2.docx

Microsoft Word - [2017SMA][T8]OOPT_Stage_2040 ver2.docx OOPT Stage 2040 - Design Feesual CPT Tool Project Team T8 Date 2017-05-24 T8 Team Information 201211347 박성근 201211376 임제현 201411270 김태홍 2017 Team 8 1 Table of Contents 1. Activity 2041. Design Real Use

More information

10 강. 쉘스크립트 l 쉘스크립트 Ÿ 쉘은명령어들을연속적으로실행하는인터프리터환경을제공 Ÿ 쉘스크립트는제어문과변수선언등이가능하며프로그래밍언어와유사 Ÿ 프로그래밍언어와스크립트언어 -프로그래밍언어를사용하는경우소스코드를컴파일하여실행가능한파일로만들어야함 -일반적으로실행파일은다

10 강. 쉘스크립트 l 쉘스크립트 Ÿ 쉘은명령어들을연속적으로실행하는인터프리터환경을제공 Ÿ 쉘스크립트는제어문과변수선언등이가능하며프로그래밍언어와유사 Ÿ 프로그래밍언어와스크립트언어 -프로그래밍언어를사용하는경우소스코드를컴파일하여실행가능한파일로만들어야함 -일반적으로실행파일은다 10 강. 쉘스크립트 쉘스크립트 쉘은명령어들을연속적으로실행하는인터프리터환경을제공 쉘스크립트는제어문과변수선언등이가능하며프로그래밍언어와유사 프로그래밍언어와스크립트언어 -프로그래밍언어를사용하는경우소스코드를컴파일하여실행가능한파일로만들어야함 -일반적으로실행파일은다른운영체제로이식되지않음 -스크립트언어를사용하면컴파일과정이없고인터프리터가소스파일에서명령문을판독하여각각의명령을수행

More information

iii. Design Tab 을 Click 하여 WindowBuilder 가자동으로생성한 GUI 프로그래밍환경을확인한다.

iii. Design Tab 을 Click 하여 WindowBuilder 가자동으로생성한 GUI 프로그래밍환경을확인한다. Eclipse 개발환경에서 WindowBuilder 를이용한 Java 프로그램개발 이예는 Java 프로그램의기초를이해하고있는사람을대상으로 Embedded Microcomputer 를이용한제어시스템을 PC 에서 Serial 통신으로제어 (Graphical User Interface (GUI) 환경에서 ) 하는프로그램개발예를설명한다. WindowBuilder:

More information

C 언어 프로그래밊 과제 풀이

C 언어 프로그래밊 과제 풀이 과제풀이 (1) 홀수 / 짝수판정 (1) /* 20094123 홍길동 20100324 */ /* even_or_odd.c */ /* 정수를입력받아홀수인지짝수인지판정하는프로그램 */ int number; printf(" 정수를입력하시오 => "); scanf("%d", &number); 확인 주석문 가필요한이유 printf 와 scanf 쌍

More information

<B0A3C3DFB0E828C0DBBEF7292E687770>

<B0A3C3DFB0E828C0DBBEF7292E687770> 초청연자특강 대구가톨릭의대의학통계학교실 Meta analysis ( 메타분석 ) 예1) The effect of interferon on development of hepatocellular carcinoma in patients with chronic hepatitis B virus infection?? -:> 1998.1 ~2007.12.31 / RCT(2),

More information

歯엑셀모델링

歯엑셀모델링 I II II III III I VBA Understanding Excel VBA - 'VB & VBA In a Nutshell' by Paul Lomax, October,1998 To enter code: Tools/Macro/visual basic editor At editor: Insert/Module Type code, then compile by:

More information

<443A5C4C C4B48555C B3E25C32C7D0B1E25CBCB3B0E8C7C1B7CEC1A7C6AE425CBED0C3E0C7C1B7CEB1D7B7A55C D616E2E637070>

<443A5C4C C4B48555C B3E25C32C7D0B1E25CBCB3B0E8C7C1B7CEC1A7C6AE425CBED0C3E0C7C1B7CEB1D7B7A55C D616E2E637070> #include "stdafx.h" #include "Huffman.h" 1 /* 비트의부분을뽑아내는함수 */ unsigned HF::bits(unsigned x, int k, int j) return (x >> k) & ~(~0

More information

목차 포인터의개요 배열과포인터 포인터의구조 실무응용예제 C 2

목차 포인터의개요 배열과포인터 포인터의구조 실무응용예제 C 2 제 8 장. 포인터 목차 포인터의개요 배열과포인터 포인터의구조 실무응용예제 C 2 포인터의개요 포인터란? 주소를변수로다루기위한주소변수 메모리의기억공간을변수로써사용하는것 포인터변수란데이터변수가저장되는주소의값을 변수로취급하기위한변수 C 3 포인터의개요 포인터변수및초기화 * 변수데이터의데이터형과같은데이터형을포인터 변수의데이터형으로선언 일반변수와포인터변수를구별하기위해

More information

PowerPoint Presentation

PowerPoint Presentation 객체지향프로그래밍 클래스, 객체, 메소드 ( 실습 ) 손시운 ssw5176@kangwon.ac.kr 예제 1. 필드만있는클래스 텔레비젼 2 예제 1. 필드만있는클래스 3 예제 2. 여러개의객체생성하기 4 5 예제 3. 메소드가추가된클래스 public class Television { int channel; // 채널번호 int volume; // 볼륨 boolean

More information

슬라이드 1

슬라이드 1 / 유닉스시스템개요 / 파일 / 프로세스 01 File Descriptor file file descriptor file type unix 에서의파일은단지바이트들의나열임 operating system 은파일에어떤포맷도부과하지않음 파일의내용은바이트단위로주소를줄수있음 file descriptor 는 0 이나양수임 file 은 open 이나 creat 로 file

More information

윈도우즈프로그래밍(1)

윈도우즈프로그래밍(1) 제어문 (2) For~Next 문 윈도우즈프로그래밍 (1) ( 신흥대학교컴퓨터정보계열 ) 2/17 Contents 학습목표 프로그램에서주어진특정문장을부분을일정횟수만큼반복해서실행하는문장으로 For~Next 문등의구조를이해하고활용할수있다. 내용 For~Next 문 다중 For 문 3/17 제어문 - FOR 문 반복문 : 프로그램에서주어진특정문장들을일정한횟수만큼반복해서실행하는문장

More information

02 C h a p t e r Java

02 C h a p t e r Java 02 C h a p t e r Java Bioinformatics in J a va,, 2 1,,,, C++, Python, (Java),,, (http://wwwbiojavaorg),, 13, 3D GUI,,, (Java programming language) (Sun Microsystems) 1995 1990 (green project) TV 22 CHAPTER

More information

歯처리.PDF

歯처리.PDF E06 (Exception) 1 (Report) : { $I- } { I/O } Assign(InFile, InputName); Reset(InFile); { $I+ } { I/O } if IOResult 0 then { }; (Exception) 2 2 (Settling State) Post OnValidate BeforePost Post Settling

More information

1217 WebTrafMon II

1217 WebTrafMon II (1/28) (2/28) (10 Mbps ) Video, Audio. (3/28) 10 ~ 15 ( : telnet, ftp ),, (4/28) UDP/TCP (5/28) centralized environment packet header information analysis network traffic data, capture presentation network

More information

저작자표시 - 비영리 - 변경금지 2.0 대한민국 이용자는아래의조건을따르는경우에한하여자유롭게 이저작물을복제, 배포, 전송, 전시, 공연및방송할수있습니다. 다음과같은조건을따라야합니다 : 저작자표시. 귀하는원저작자를표시하여야합니다. 비영리. 귀하는이저작물을영리목적으로이용할

저작자표시 - 비영리 - 변경금지 2.0 대한민국 이용자는아래의조건을따르는경우에한하여자유롭게 이저작물을복제, 배포, 전송, 전시, 공연및방송할수있습니다. 다음과같은조건을따라야합니다 : 저작자표시. 귀하는원저작자를표시하여야합니다. 비영리. 귀하는이저작물을영리목적으로이용할 저작자표시 - 비영리 - 변경금지 2.0 대한민국 이용자는아래의조건을따르는경우에한하여자유롭게 이저작물을복제, 배포, 전송, 전시, 공연및방송할수있습니다. 다음과같은조건을따라야합니다 : 저작자표시. 귀하는원저작자를표시하여야합니다. 비영리. 귀하는이저작물을영리목적으로이용할수없습니다. 변경금지. 귀하는이저작물을개작, 변형또는가공할수없습니다. 귀하는, 이저작물의재이용이나배포의경우,

More information

강의 개요

강의 개요 DDL TABLE 을만들자 웹데이터베이스 TABLE 자료가저장되는공간 문자자료의경우 DB 생성시지정한 Character Set 대로저장 Table 생성시 Table 의구조를결정짓는열속성지정 열 (Clumn, Attribute) 은이름과자료형을갖는다. 자료형 : http://dev.mysql.cm/dc/refman/5.1/en/data-types.html TABLE

More information

Java ...

Java ... 컴퓨터언어 1 Java 제어문 조성일 조건문 : if, switch 어떠한조건을조사하여각기다른명령을실행 if 문, switch 문 if 문 if - else 문형식 if 문형식 if ( 조건식 ) { 명령문 1; 명령문 2;... if ( 조건식 ) { 명령문 1; 명령문 2;... else { 명령문 a; 명령문 b;... 예제 1 정수를입력받아짝수와홀수를판별하는프로그램을작성하시오.

More information

PCServerMgmt7

PCServerMgmt7 Web Windows NT/2000 Server DP&NM Lab 1 Contents 2 Windows NT Service Provider Management Application Web UI 3 . PC,, Client/Server Network 4 (1),,, PC Mainframe PC Backbone Server TCP/IP DCS PLC Network

More information

R Cookbook

R Cookbook 일반통계 with R 귀무가설아무것도일어나지않은경우. 해당변수들이서로독립적이다. 대립가설귀무가설과반대되는가설. 무엇인가일어난경우. 해당변수들이서로독립적이지않다. 가설검정과정 1. 귀무가설이참이라고가정. 2. 검정통계량을계산. 표본의평균처럼단순한것일수도있고, 복잡한것일수도있다. 해당통계의분포는알아야함. 표본평균의분포는중심극한정리를사용하면된다. 3. 통계량과그것의분포로부터

More information

서론 34 2

서론 34 2 34 2 Journal of the Korean Society of Health Information and Health Statistics Volume 34, Number 2, 2009, pp. 165 176 165 진은희 A Study on Health related Action Rates of Dietary Guidelines and Pattern of

More information

PowerPoint Presentation

PowerPoint Presentation 자바프로그래밍 1 배열 손시운 ssw5176@kangwon.ac.kr 배열이필요한이유 예를들어서학생이 10 명이있고성적의평균을계산한다고가정하자. 학생 이 10 명이므로 10 개의변수가필요하다. int s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; 하지만만약학생이 100 명이라면어떻게해야하는가? int s0, s1, s2, s3, s4,

More information

chap01_time_complexity.key

chap01_time_complexity.key 1 : (resource),,, 2 (time complexity),,, (worst-case analysis) (average-case analysis) 3 (Asymptotic) n growth rate Θ-, Ο- ( ) 4 : n data, n/2. int sample( int data[], int n ) { int k = n/2 ; return data[k]

More information

Microsoft PowerPoint - java1-lab5-ImageProcessorTestOOP.pptx

Microsoft PowerPoint - java1-lab5-ImageProcessorTestOOP.pptx 2018 학년도 1 학기 JAVA 프로그래밍 II 514760-1 2018 년봄학기 5/10/2018 박경신 Lab#1 (ImageTest) Lab#1 은영상파일 (Image) 을읽어서정보를출력 Java Tutorials Lesson: Working with Images https://docs.oracle.com/javase/tutorial/2d/images/index.html

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 Programming Languages 모듈과펑터 2016 년봄학기 손시운 (ssw5176@kangwon.ac.kr) 담당교수 : 임현승교수님 모듈 (module) 관련있는정의 ( 변수또는함수 ) 를하나로묶은패키지 예약어 module과 struct end를사용하여정의 아래는모듈의예시 ( 우선순위큐, priority queue) # module PrioQueue

More information

제 11 장포인터 유준범 (JUNBEOM YOO) Ver 본강의자료는생능출판사의 PPT 강의자료 를기반으로제작되었습니다.

제 11 장포인터 유준범 (JUNBEOM YOO) Ver 본강의자료는생능출판사의 PPT 강의자료 를기반으로제작되었습니다. 제 11 장포인터 유준범 (JUNBEOM YOO) Ver. 2.0 jbyoo@konkuk.ac.kr http://dslab.konkuk.ac.kr 본강의자료는생능출판사의 PPT 강의자료 를기반으로제작되었습니다. 이번장에서학습할내용 포인터이란? 변수의주소 포인터의선언 간접참조연산자 포인터연산 포인터와배열 포인터와함수 이번장에서는포인터의기초적인지식을학습합니다.

More information

1 경영학을 위한 수학 Final Exam 2015/12/12(토) 13:00-15:00 풀이과정을 모두 명시하시오. 정리를 사용할 경우 명시하시오. 1. (각 6점) 다음 적분을 구하시오 Z 1 4 Z 1 (x + 1) dx (a) 1 (x 1)4 dx 1 Solut

1 경영학을 위한 수학 Final Exam 2015/12/12(토) 13:00-15:00 풀이과정을 모두 명시하시오. 정리를 사용할 경우 명시하시오. 1. (각 6점) 다음 적분을 구하시오 Z 1 4 Z 1 (x + 1) dx (a) 1 (x 1)4 dx 1 Solut 경영학을 위한 수학 Fial Eam 5//(토) :-5: 풀이과정을 모두 명시하시오. 정리를 사용할 경우 명시하시오.. (각 6점) 다음 적분을 구하시오 4 ( ) (a) ( )4 8 8 (b) d이 성립한다. d C C log log (c) 이다. 양변에 적분을 취하면 log C (d) 라 하자. 그러면 d 4이다. 9 9 4 / si (e) cos si

More information

Polly_with_Serverless_HOL_hyouk

Polly_with_Serverless_HOL_hyouk { } "Version":"2012-10-17", "Statement":[ { "Effect":"Allow", "Action":[ "polly:synthesizespeech", "dynamodb:query", "dynamodb:scan", "dynamodb:putitem", "dynamodb:updateitem", "sns:publish", "s3:putobject",

More information

17장 클래스와 메소드

17장 클래스와 메소드 17 장클래스와메소드 박창이 서울시립대학교통계학과 박창이 ( 서울시립대학교통계학과 ) 17 장클래스와메소드 1 / 18 학습내용 객체지향특징들객체출력 init 메소드 str 메소드연산자재정의타입기반의버전다형성 (polymorphism) 박창이 ( 서울시립대학교통계학과 ) 17 장클래스와메소드 2 / 18 객체지향특징들 객체지향프로그래밍의특징 프로그램은객체와함수정의로구성되며대부분의계산은객체에대한연산으로표현됨객체의정의는

More information

Microsoft PowerPoint 웹 연동 기술.pptx

Microsoft PowerPoint 웹 연동 기술.pptx 웹프로그래밍및실습 ( g & Practice) 문양세강원대학교 IT 대학컴퓨터과학전공 URL 분석 (1/2) URL (Uniform Resource Locator) 프로토콜, 호스트, 포트, 경로, 비밀번호, User 등의정보를포함 예. http://kim:3759@www.hostname.com:80/doc/index.html URL 을속성별로분리하고자할경우

More information

SQL Developer Connect to TimesTen 유니원아이앤씨 DB 기술지원팀 2010 년 07 월 28 일 문서정보 프로젝트명 SQL Developer Connect to TimesTen 서브시스템명 버전 1.0 문서명 작성일 작성자

SQL Developer Connect to TimesTen 유니원아이앤씨 DB 기술지원팀 2010 년 07 월 28 일 문서정보 프로젝트명 SQL Developer Connect to TimesTen 서브시스템명 버전 1.0 문서명 작성일 작성자 SQL Developer Connect to TimesTen 유니원아이앤씨 DB 팀 2010 년 07 월 28 일 문서정보 프로젝트명 SQL Developer Connect to TimesTen 서브시스템명 버전 1.0 문서명 작성일 2010-07-28 작성자 김학준 최종수정일 2010-07-28 문서번호 20100728_01_khj 재개정이력 일자내용수정인버전

More information

Vector Differential: 벡터 미분 Yonghee Lee October 17, 벡터미분의 표기 스칼라미분 벡터미분(Vector diffrential) 또는 행렬미분(Matrix differential)은 벡터와 행렬의 미분식에 대 한 표

Vector Differential: 벡터 미분 Yonghee Lee October 17, 벡터미분의 표기 스칼라미분 벡터미분(Vector diffrential) 또는 행렬미분(Matrix differential)은 벡터와 행렬의 미분식에 대 한 표 Vector Differential: 벡터 미분 Yonhee Lee October 7, 08 벡터미분의 표기 스칼라미분 벡터미분(Vector diffrential) 또는 행렬미분(Matrix differential)은 벡터와 행렬의 미분식에 대 한 표기법을 정의하는 방법이다 보통 스칼라(scalar)에 대한 미분은 일분수 함수 f : < < 또는 다변수 함수(function

More information

Modern Javascript

Modern Javascript ES6 - Arrow Function Class Template String Destructuring Default, Rest, Spread let, const for..of Promises Module System Map, Set * Generator * Symbol * * https://babeljs.io/ Babel is a JavaScript compiler.

More information

SIGPLwinterschool2012

SIGPLwinterschool2012 1994 1992 2001 2008 2002 Semantics Engineering with PLT Redex Matthias Felleisen, Robert Bruce Findler and Matthew Flatt 2009 Text David A. Schmidt EXPRESSION E ::= N ( E1 O E2 ) OPERATOR O ::=

More information

Orcad Capture 9.x

Orcad Capture 9.x OrCAD Capture Workbook (Ver 10.xx) 0 Capture 1 2 3 Capture for window 4.opj ( OrCAD Project file) Design file Programe link file..dsn (OrCAD Design file) Design file..olb (OrCAD Library file) file..upd

More information

OCW_C언어 기초

OCW_C언어 기초 초보프로그래머를위한 C 언어기초 4 장 : 연산자 2012 년 이은주 학습목표 수식의개념과연산자및피연산자에대한학습 C 의알아보기 연산자의우선순위와결합방향에대하여알아보기 2 목차 연산자의기본개념 수식 연산자와피연산자 산술연산자 / 증감연산자 관계연산자 / 논리연산자 비트연산자 / 대입연산자연산자의우선순위와결합방향 조건연산자 / 형변환연산자 연산자의우선순위 연산자의결합방향

More information