diff --git a/translations/korean/base-r_ko.pdf b/translations/korean/base-r_ko.pdf new file mode 100644 index 00000000..716a5318 Binary files /dev/null and b/translations/korean/base-r_ko.pdf differ diff --git a/translations/korean/base-r_ko/base-r_ko.tex b/translations/korean/base-r_ko/base-r_ko.tex new file mode 100644 index 00000000..997ab335 --- /dev/null +++ b/translations/korean/base-r_ko/base-r_ko.tex @@ -0,0 +1,76 @@ +\documentclass[final,hyperref={pdfpagelabels=false}]{beamer} + +\usepackage{macros} + +\usefolder{../} +\usetheme{CS} + +%%%%%% To change the theme color, uncomment the following lines and set your own color. %%%%%% +%%%%%%%% You can also directly modify the colors in the file beamercolorthemeCS.sty %%%%%%%% +% +%\definecolor{mycolor}{rgb}{0.8, 0, 0.4} +%\definecolor{mycodecolor}{rgb}{0.4, 0.6, 0.8} +%\colorlet{codebg}{mycodecolor} +% +%\setbeamercolor{structure}{bg = mycolor} +%\setbeamercolor{title page}{fg = mycolor} +%\setbeamercolor{alerted text}{fg = mycolor, bg = main} +%\setbeamercolor{block title example}{fg = mycolor} + +\usepackage{times} +\usepackage{amsmath,amsthm, amssymb, latexsym} +\boldmath +\usepackage[english]{babel} +\usepackage{kotex} +\usepackage[orientation=landscale, size=a4, scale=1.5, debug]{beamerposter} + +\usepackage{tikz} +\usetikzlibrary{arrows} + +\def\q{\textquotesingle} + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5 + \graphicspath{{figures/}} + + \title{Base R} + \subtitle{Cheatsheet} + + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + \begin{document} + + \begin{frame}[fragile]{} + \vfill + \begin{columns}[t] + \begin{column}{.25\linewidth} + \maketitle + \input{firstcolumn} + \end{column} + + \begin{column}{.25\linewidth} + \input{secondcolumn} + \end{column} + + \begin{column}{.50\linewidth} + \input{thirdcolumn} + \end{column} + \end{columns} + \vfill + \end{frame} + + \begin{frame}[fragile]{} + \begin{columns}[t] + \begin{column}{0.33\linewidth} + \input{fourthcolumn} + \end{column} + + \begin{column}{0.33\linewidth} + \input{fifthcolumn} + \end{column} + + \begin{column}{0.33\linewidth} + \input{sixthcolumn} + \end{column} + \end{columns} + \end{frame} +\end{document} \ No newline at end of file diff --git a/translations/korean/base-r_ko/fifthcolumn.tex b/translations/korean/base-r_ko/fifthcolumn.tex new file mode 100644 index 00000000..3d706b86 --- /dev/null +++ b/translations/korean/base-r_ko/fifthcolumn.tex @@ -0,0 +1,217 @@ +% !TEX root = base-r.tex + +{\setbeamercolor{block body}{fg = black, bg = white} +\begin{block}{리스트} + \centering + \inlc{l <- list(x = 1:5, y = c('a', 'b'))}\\{\small 리스트는 자료형에 상관없이 여러 개의 원소를 가지는 집합} + + \smallskip + {\color{gray}\hrule} + + \smallskip + \begin{tabular}{*{4}{>{\centering\arraybackslash}m{0.215\linewidth}}} + \inlc{l[[2]]} & \inlc{l[1]} & \inlc{l\$x} & \inlc{l['y']}\\ + l의 두번째 원소 & 첫 번째 원소만 있는 새 리스트 & x라는 이름의 원소 & y라는 이름의 원소만 있는 새 리스트. + \end{tabular} +\end{block} +} + +\begin{block}{행렬} + \begin{column}[t]{0.5\linewidth} + \begin{tabular}{>{\centering\arraybackslash} m{0.65cm} c @{-~~} l} + \begin{tikzpicture}[scale = 0.3] + \foreach \x in {0, 1, 2} + \foreach \y in {0, 2} + \filldraw[lightgray!65] (\x, \y) rectangle ({\x + 0.8}, {\y + 0.8}); + \foreach \x in {0, 1, 2} + \filldraw[yellow!75!orange] (\x, 1) rectangle ({\x + 0.8}, {1 + 0.8}); + \end{tikzpicture} + & \inlc{m[2, ]} & 열 선택\\ + \begin{tikzpicture}[scale = 0.3] + \foreach \y in {0, 1, 2} + \foreach \x in {1, 2} + \filldraw[lightgray!65] (\x, \y) rectangle ({\x + 0.8}, {\y + 0.8}); + \foreach \y in {0, 1, 2} + \filldraw[yellow!75!orange] (0, \y) rectangle ({0 + 0.8}, {\y + 0.8}); + \end{tikzpicture} + & \inlc{m[ ,1]} & 행 선택\\ + \begin{tikzpicture}[scale = 0.3] + \foreach \x in {0, 1, 2} + \foreach \y in {0, 1, 2} + \filldraw[lightgray!65] (\x, \y) rectangle ({\x + 0.8}, {\y + 0.8}); + \filldraw[yellow!75!orange] (2, 1) rectangle ({2 + 0.8}, {1 + 0.8}); + \end{tikzpicture} + & \inlc{m[2,3]} & 원소 선택 + \end{tabular} + \end{column} + {\color{gray}\vrule} + \begin{column}[t]{0.35\linewidth} + \vspace{-10ex} + \flushright + \inl{t(m)}\\ 전치 + + \inl{m \%*\% n}\\{ 행렬곱} + + \inl{solve(m,n)}\\{ \inl{m*x = n}의 해 찾기} + \end{column} +\end{block} + +{\setbeamercolor{block body}{fg = black, bg = white} +\begin{seeblock}{데이터프레임}{dplyr} + {\fontsize{9pt}{11pt}\selectfont\inlc{df <- data.frame(x = 1:3, y = c('a', 'b', 'c'))}\\모든 원소의 길이가 같은 리스트의 특수한 케이스} + + \begin{column}{0.35\linewidth} + + \renewcommand{\arraystretch}{1.75} + \color{secondary} + \begin{tabular}{| >{\centering\arraybackslash\color{black}} m{0.75cm} | >{\centering\arraybackslash\color{black}} m{0.75cm} |} + \hline + \rowcolor{codebg}\color{white} x & \color{white}y\\\hline + \rowcolor{white} 1 & a\\\hline + \rowcolor{white} 2 & b\\\hline + \rowcolor{white} 3 & c\\\hline + \end{tabular} + \end{column} +% + \begin{column}{0.65\linewidth} + \vspace{-3ex} + \begin{center}\textbf{리스트로 자르기}\end{center} + \begin{tabular}{c >{\centering\arraybackslash} m{0.65cm} c m{0.65cm}} + \inlc{df\$x} & + \begin{tikzpicture}[xscale = 0.4, yscale = 0.3] + \foreach \y in {0, 1, 2} + \filldraw[yellow!75!orange] (0, \y) rectangle ({0 + 0.8}, {\y + 0.8}); + \filldraw[yellow!70!black] (0, 3) rectangle ({0 + 0.8}, {3 + 0.8}); + \foreach \y in {0, 1, 2} + \filldraw[white] (1, \y) rectangle ({1 + 0.8}, {\y + 0.8}); + \filldraw[codebg] (1, 3) rectangle ({1 + 0.8}, {3 + 0.8}); + \end{tikzpicture} & + \inlc{df[[2]]} & + \begin{tikzpicture}[xscale = 0.4, yscale = 0.3] + \foreach \y in {0, 1, 2} + \filldraw[yellow!75!orange] (1, \y) rectangle ({1 + 0.8}, {\y + 0.8}); + \filldraw[yellow!70!black] (1, 3) rectangle ({1 + 0.8}, {3 + 0.8}); + \foreach \y in {0, 1, 2} + \filldraw[white] (0, \y) rectangle ({0 + 0.8}, {\y + 0.8}); + \filldraw[codebg] (0, 3) rectangle ({0 + 0.8}, {3 + 0.8}); + \end{tikzpicture} + \end{tabular} + \vspace{-1.5ex} + \begin{center} + \begin{tikzpicture}[remember picture, overlay] + \draw[darkgray, dotted, very thick, rounded corners] (-3, 0) rectangle (3, -1.5); + \end{tikzpicture} + + \textit{데이터프레임 파악하기} + + \smallskip + \begin{tabular}{c l} + \inl{view(df)} & 전체 데이터프레임 보기\\ + \inl{head(df)} & 첫 6열까지만 보기 + \end{tabular} + \end{center} + \end{column} + + \bigskip + \textbf{행렬로 자르기} + + \medskip + \begin{column}{0.33\linewidth} + \begin{tabular}{c >{\centering\arraybackslash} m{0.65cm}} + \inlc{df[ ,2]} & + \begin{tikzpicture}[xscale = 0.4, yscale = 0.3] + \foreach \y in {0, 1, 2} + \filldraw[yellow!70!orange] (1, \y) rectangle ({1 + 0.8}, {\y + 0.8}); + \filldraw[yellow!75!black] (1, 3) rectangle ({1 + 0.8}, {3 + 0.8}); + \foreach \y in {0, 1, 2} + \filldraw[white] (0, \y) rectangle ({0 + 0.8}, {\y + 0.8}); + \filldraw[codebg] (0, 3) rectangle ({0 + 0.8}, {3 + 0.8}); + \end{tikzpicture}\\[0.75ex] + \inlc{df[2, ]} & + \begin{tikzpicture}[xscale = 0.4, yscale = 0.3] + \foreach \x in {0, 1} { + \filldraw[codebg] (\x, 3) rectangle ({\x + 0.8}, {3 + 0.8}); + \filldraw[white] (\x, 0) rectangle ({\x + 0.8}, {0 + 0.8}); + \filldraw[white] (\x, 2) rectangle ({\x + 0.8}, {2 + 0.8}); + \filldraw[yellow!75!orange] (\x, 1) rectangle ({\x + 0.8}, {1 + 0.8}); + } + \end{tikzpicture}\\[0.75ex] + \inlc{df[2,2]} & + \begin{tikzpicture}[xscale = 0.4, yscale = 0.3] + \foreach \x in {0, 1} { + \filldraw[codebg] (\x, 3) rectangle ({\x + 0.8}, {3 + 0.8}); + \foreach \y in {0, 1, 2} + \filldraw[white] (\x, \y) rectangle ({\x + 0.8}, {\y + 0.8}); + } + \filldraw[yellow!75!orange] (1, 1) rectangle ({1 + 0.8}, {1 + 0.8}); + \end{tikzpicture}\\ + \end{tabular} + \end{column} + {\color{gray}{\vrule}} + \begin{column}{0.24\linewidth} + \vspace{-13ex} + + \inl{nrow(df)}\\열 개수 + + \inl{ncol(df)}\\행 개수 + + \inl{dim(df)}\\행과 열의 개수 + \end{column} + {\color{gray}{\vrule}} + \begin{column}{0.4\linewidth} + \vspace{-12ex} + + \inl{cbind} - 열로 합치기 + + \smallskip + {\centering + \begin{tikzpicture}[xscale = 0.4, yscale = 0.3] + \foreach \x in {0, 1} { + \filldraw[codebg] (\x, 3) rectangle ({\x + 0.8}, {3 + 0.8}); + \foreach \y in {0, 1, 2} + \filldraw[white] (\x, \y) rectangle ({\x + 0.8}, {\y + 0.8}); + } + + \foreach \y in {0, 1, 2} + \filldraw[red] (2.5, \y) rectangle ({2.5 + 0.8}, {\y + 0.8}); + \filldraw[red!70!black] (2.5, 3) rectangle ({2.5 + 0.8}, {3 + 0.8}); + + \draw[->, > = stealth', ultra thick, main] (3.75, 1.5) -- (5.35, 1.5); + + \foreach \x in {6, 7, 8} { + \foreach \y in {0, 1, 2} + \filldraw[green] (\x, \y) rectangle ({\x + 0.8}, {\y + 0.8}); + \filldraw[green!70!black] (\x, 3) rectangle ({\x + 0.8}, {3 + 0.8}); + } + \end{tikzpicture}} + + \smallskip + \inl{rbind} - 행으로 합치기 + + \smallskip + {\centering + \begin{tikzpicture}[xscale = 0.4, yscale = 0.3] + \foreach \x in {0, 1} { + \filldraw[codebg] (\x, 3) rectangle ({\x + 0.8}, {3 + 0.8}); + \foreach \y in {0, 1, 2} + \filldraw[white] (\x, \y) rectangle ({\x + 0.8}, {\y + 0.8}); + } + + \foreach \x in {2.5, 3.5} { + \filldraw[red] (\x, 1) rectangle ({\x + 0.8}, {1 + 0.8}); + \filldraw[red!70!black] (\x, 2) rectangle ({\x + 0.8}, {2 + 0.8}); + } + + \draw[->, > = stealth', ultra thick, main] (4.75, 1.5) -- (6.35, 1.5); + + \foreach \x in {7, 8} { + \foreach \y in {-0.5, 0.5, 1.5, 2.5} + \filldraw[green] (\x, \y) rectangle ({\x + 0.8}, {\y + 0.8}); + \filldraw[green!70!black] (\x, 3.5) rectangle ({\x + 0.8}, {3.5 + 0.8}); + } + + \end{tikzpicture}} + + \end{column} +\end{seeblock} +} \ No newline at end of file diff --git a/translations/korean/base-r_ko/firstcolumn.tex b/translations/korean/base-r_ko/firstcolumn.tex new file mode 100644 index 00000000..2f87f127 --- /dev/null +++ b/translations/korean/base-r_ko/firstcolumn.tex @@ -0,0 +1,26 @@ +% !TEX root = base-r.tex + +\begin{block}{사용법 도움받기} + + \blocksubtitle{매뉴얼 보기} + \inline{?mean}\\특정 함수에 대한 도움 받기\br + \inline{help.search('weighted mean')}\\특정 단어나 문구에 대한 사용법 찾기\br + \inline{help(package = 'dplyr')}\\패키지 사용법 찾기 + + \blocksubtitle{오브젝트 정보 더보기} + \inline{str(iris)}\\오브젝트의 구조에 대한 요약 보기\br + \inline{class(iris)}\\오브젝트가 소속된 클래스 찾기 +\end{block} + +\begin{block}{패키지 사용하기} + \inline{install.packages('dplyr')}\\CRAN에서 패키지를 다운로드하고 설치\br + \inline{library(dplyr)}\\세션에 패키지 불러오기\br + \inline{dplyr::select}\\패키지에서 특정 함수 사용\br + \inline{data(iris)}\\내장 데이터셋을 environment에 불러오기 +\end{block} + +\begin{block}{작업 디렉토리} + \inline{getwd()}\\현재 작업 디렉토리 찾기\br + \inline{setwd('C://file/path')}\\현재 작업 디렉토리 변경\br + \textbf{RStudio의 project를 사용해 작업 디렉토리를 현재 폴더로 변경할 수 있음} +\end{block} \ No newline at end of file diff --git a/translations/korean/base-r_ko/fourthcolumn.tex b/translations/korean/base-r_ko/fourthcolumn.tex new file mode 100644 index 00000000..4d3c1823 --- /dev/null +++ b/translations/korean/base-r_ko/fourthcolumn.tex @@ -0,0 +1,64 @@ +% !TEX root = base-r.tex + +\begin{block}{자료형} + \vspace{1ex} + + \centering + \begin{minipage}{0.8\linewidth} + \centering + 자주 쓰는 자료형간의 변환. 표 아래쪽의 값에서 위쪽의 값으로는 항상 변환 가능하다. + \end{minipage} + + \vspace{1ex} + + \small\renewcommand{\arraystretch}{1.3} + \begin{tableau}{>{\color{black}}l | >{\color{darkgray}}m{0.31\linewidth} | >{\color{black}\centering\arraybackslash}m{0.35\linewidth}} + \inl{as.logical} & \inl{TRUE, FALSE, TRUE} & Boolean 값 (참 아니면 거짓)\\ + \inl{as.numeric} & \inl{1, 0, 1} & 정수나 실수\\ + \inl{as.character} & \inl{'1', '0', '1'} & 문자열. 팩터에서 자주 사용함\\ + \inl{as.factor} & \inl{'1', '0', '1'}\qquad\inl{levels: '1', '0'} & level이 정해진 문자열. 몇몇 통계모델에 필요함\\ + \end{tableau} + +\end{block} + +{\setbeamercolor{block body}{fg = black, bg = white} +\begin{block}{수학 함수} + \small\renewcommand{\arraystretch}{1.3} + \begin{tabular}{r m{0.25\linewidth} r m{0.25\linewidth}} + \inl{log(x)} & 자연로그 & \inl{sum(x)} & 합\\ + \inl{exp(x)} & 지수함수 & \inl{mean(x)} & 평균\\ + \inl{max(x)} & 최댓값 & \inl{median(x)} & 중앙값\\ + \inl{min(x)} & 최솟값 & \inl{quantile(x)} & 사분위수\\ + \inl{(x, n)} & 소수점 n째자리까지 반올림 & \inl{rank(x)} & 원소의 큰 순서\\ + \inl{(x, n)} & 유효숫자 n자리 & \inl{var(x)} & 분산\\ + \inl{(x, y)} & 상관계수 & \inl{sd(x)} & 표준편차. + \end{tabular} +\end{block} +} + +\begin{block}{변수 할당} + \begin{code} + \begin{Pseudo} + > a <- 'apple' + > a + [1] 'apple' + \end{Pseudo} + \end{code} +\end{block} + +\begin{block}{Environment} + \renewcommand{\arraystretch}{1.3} + \begin{tabular}{l m{0.6\linewidth}} + \inline{ls()} & environment의 모든 변수 나열\\ + \inline{rm(x)} & environment에서 x 제거\\ + \inline{rm(list = ls())} & environment에서 모든 변수 제거 + \end{tabular} + + \vspace{1ex} + + \centering + \begin{minipage}{0.8\linewidth} + \centering + \textbf{RStudio의 environment 패널로 environment의 변수들을 볼 수 있음} + \end{minipage} +\end{block} diff --git a/translations/korean/base-r_ko/macros.sty b/translations/korean/base-r_ko/macros.sty new file mode 100644 index 00000000..6006417b --- /dev/null +++ b/translations/korean/base-r_ko/macros.sty @@ -0,0 +1,10 @@ +\makeatletter + \def\beamer@calltheme#1#2#3{% + \def\beamer@themelist{#2} + \@for\beamer@themename:=\beamer@themelist\do + {\usepackage[{#1}]{\beamer@themelocation/#3\beamer@themename}}} + + \def\usefolder#1{ + \def\beamer@themelocation{#1} + } + \def\beamer@themelocation{} diff --git a/translations/korean/base-r_ko/secondcolumn.tex b/translations/korean/base-r_ko/secondcolumn.tex new file mode 100644 index 00000000..569bc9e8 --- /dev/null +++ b/translations/korean/base-r_ko/secondcolumn.tex @@ -0,0 +1,50 @@ +% !TEX root = base-r.tex + +\begin{block}{벡터} + \begin{subblock}{벡터 생성하기} + \scriptsize\vspace{5pt}\hspace{-8pt} + \begin{tableau}{| >{\color{black}}m{2.2cm} | >{\color{white}\cellcolor{codebg}}m{1.401cm} | >{\color{black}\centering\arraybackslash}m{1.45cm} |} + \hline + \inl{c(2, 4, 6)} & \inl{2 4 6} & 주어진 원소를 가지는 벡터 생성\\\hline + \rowcolor{secondary} \inl{2:6} & \inl{2 3 4 5 6} & 정수 수열\\\hline + \inl{seq(2, 3, by=0.5)} & \inl{2.0 2.5 3.0} & 복잡한 수열\\\hline + \rowcolor{secondary} \inl{rep(1:2, times=3)} & \inl{1 2 1 2 1 2} & 벡터 반복\\\hline + \inl{rep(1:2, each=3)} & \inl{1 1 1 2 2 2} & 벡터의 원소 반복\\\hline + \end{tableau} + \vskip-1ex + \end{subblock} + + \begin{subblock}{벡터 함수} + \begin{columns}[t] + \hspace{4ex} + \begin{column}{0.55\linewidth} + \inlc{sort(x)}\\x 정렬해서 반환\br + \inlc{table(x)}\\값들의 개수 보기. + \end{column} + \begin{column}{0.49\linewidth} + \inlc{rev(x)}\\x 뒤집어서 반환\br + \inlc{unique(x)}\\값들의 종류 보기. + \end{column} + \hspace{4ex} + \end{columns} + \end{subblock} + + \begin{subblock}{벡터 원소 선택} + \renewcommand{\arraystretch}{1.411}\hspace{-17.5pt} + \begin{tabular}{>{\centering}m{0.48\linewidth} >{\centering\arraybackslash}m{0.47\linewidth}} + \multicolumn{2}{c}{\textcolor{gray}{\textbf{위치로 선택}}}\\ + \inlc{x[4]} & 네번째 원소\\ + \inlc{x[-4]} & 네번째 빼고 전부\\ + \inlc{x[2:4]} & 두번째부터 네번째까지\\ + \inlc{x[-(2:4)]} & 두번째부터 네번째까지 빼고 전부\\ + \inlc{x[c(1, 5)]} & 첫번째와 다섯번째 원소\\ + \multicolumn{2}{c}{\textcolor{gray}{\textbf{값으로 선택}}}\\ + \inlc{x[x == 10]} & 값이 10인 원소\\ + \inlc{x[which(x==10)]} & 값이 10인 원소\\ + \inlc{x[x < 0]} & 0보다 작은 모든 원소\\ + \inlc{x[x\%in\%c(1,2,5)]} & \{1, 2, 5\}에 속한 원소\\ + \multicolumn{2}{c}{\textcolor{gray}{\textbf{이름으로 선택}}}\\ + \inlc{x['apple']} & 이름이 'apple'인 원소. + \end{tabular} + \end{subblock} +\end{block} \ No newline at end of file diff --git a/translations/korean/base-r_ko/sixthcolumn.tex b/translations/korean/base-r_ko/sixthcolumn.tex new file mode 100644 index 00000000..914769b2 --- /dev/null +++ b/translations/korean/base-r_ko/sixthcolumn.tex @@ -0,0 +1,109 @@ +% !TEX root = base-r.tex + +\begin{seeblock}{문자열}{stringr} + \small\renewcommand{\arraystretch}{1.5} + \begin{tabular}{c >{\footnotesize} p{0.45\linewidth}} + \inline{paste(x, y, sep = ' ')} & 여러 개의 벡터 합치기\\ + \inline{paste(x, collapse = ' ')} & 벡터의 원소들 합치기\\ + \inline{grep(pattern, x)} & \inl{x}에서 정규 표현식으로 찾기\\ + \inline{gsub(pattern, replace, x)} & \inl{x}에서 해당하는 항목 대치하기\\ + \inline{toupper(x)} & 대문자화하기\\ + \inline{tolower(x)} & 소문자화하기\\ + \inline{nchar(x)} & 문자열 길이 +% \inl{sprintf(fmt, ...)} & Return a character vector containing a formatted combination of text and variable values. + \end{tabular} +\end{seeblock} + +\begin{block}{팩터} + \begin{columns}[t]\hfill + \begin{column}{.45\linewidth}\centering + \inline{factor(x)}\\벡터를 팩터로 바꾸기. 팩터의 level과 order 설정 가능 + \end{column} + \begin{column}{.45\linewidth}\centering + \inline{cut(x, breaks = 4)}\\수로 이루어진 벡터를 잘라서 팩터로 만들기 + \end{column}\hfill + \end{columns} +\end{block} + +{\setbeamercolor{block body}{fg = black, bg = white} +\begin{block}{통계} + \begin{columns}\hfill\small + \begin{column}{.45\linewidth}\centering + \begin{tikzpicture}[remember picture, overlay] + \draw[darkgray, dotted, very thick, rounded corners] (-0.45, .25) rectangle (3.35, -2.45); + \end{tikzpicture} + \inline{lm(y~x, data=df)}\\선형모형\\[1ex] + \inline{glm(y~x, data=df)}\\일반화 선형모형\\[1ex] + \inline{summary}\\모델에서 더 자세한 정보 불러오기. + \end{column}\hspace{-2ex} + \begin{column}{.3\linewidth}\centering + \inline{t.test(x, y)}\\t-검정\\[1ex] + \inline{pairwise.t.test}\\짝지어진 데이터에 대한 t-검정 + \end{column}\hspace{-2ex} + \begin{column}{.225\linewidth}\centering + \inline{prop.test}\\비율검정\\[1ex] + \inline{aov}\\분산 분석(ANOVA) + \end{column}\hfill + \end{columns} +\end{block} + +\begin{block}{분포}\small + \renewcommand{\arraystretch}{1.5} + \begin{tableau}{| >{\color{black}} c | *{2}{>{\color{black}\centering}m{0.15\linewidth} |} >{\color{black}\centering}m{0.2\linewidth} | >{\color{black}} c |} + \cline{2-5} + \multicolumn{1}{l|}{} & 난수 & 확률밀도함수 & 누적분포함수 & 분위수\\\hline + \rowcolor{secondary} 정규분포 & \inline{rnorm} & \inline{dnorm} & \inline{pnorm} & \inline{qnorm}\\\hline + 푸아송 분포 & \inline{rpois} & \inline{dpois} & \inline{ppois} & \inline{qpois}\\\hline + \rowcolor{secondary} 이항분포 & \inline{rbinom} & \inline{dbinom} & \inline{pbinom} & \inline{qbinom}\\\hline + 균등분포 & \inline{runif} & \inline{dunif} & \inline{punif} & \inline{qunif}\\\hline + \end{tableau} +\end{block} +} + +\begin{seeblock}{플로팅}{ggplot2} + \vspace{1ex} + \begin{columns}\hfill + \begin{column}{.05\linewidth}\centering + \begin{tikzpicture}[scale = 0.125] + \fill[white] (0, 0) rectangle (8, 8); + \draw[step = 1, ultra thin, gray] (0, 0) grid (8, 8); + + \foreach \x/\y in {1/4, 2/5, 3/6, 4/5, 5/4, 6/2.75, 7.25/3} + \fill[violet!65!blue] (\x, \y) circle (12pt); + \draw (0, 0) rectangle (8, 8); + \end{tikzpicture} + \end{column}\hspace{0.1ex} + \begin{column}{.2\linewidth}\centering + \inline{plot(x)}\\x의 값(순서대로) + \end{column}\hspace{-2ex} + \begin{column}{.05\linewidth}\centering + \begin{tikzpicture}[scale = 0.12] + \fill[white] (0, 0) rectangle (8, 8); + \draw[step = 1, ultra thin, gray] (0, 0) grid (8, 8); + + \foreach \x/\y in {0.5/1.75, 1.7/2, 1.7/4, 3.25/3.8, 4/5, 5/4, 5/6.6, 6/5, 6.8/6.7} + \fill[violet!65!blue] (\x, \y) circle (12pt); + \draw (0, 0) rectangle (8, 8); + \end{tikzpicture} + \end{column} + \begin{column}{.25\linewidth}\centering + \inline{plot(x, y)}\\x에 대한 y의 값 + \end{column}\hspace{-2ex} + \begin{column}{.05\linewidth}\centering + \begin{tikzpicture}[scale = 0.115] + \fill[white] (0, 0) rectangle (8, 8); + \draw[step = 1, ultra thin, gray] (0, 0) grid (8, 8); + + \fill[violet!65!blue] (0, 0) -- (0, 1) -- (1.5, 1) -- (1.5, 1.8) -- (2.75, 1.8) -- (2.75, 3.1) -- (4, 3.1) -- (4, 4.25) -- (5.15, 4.25) -- (5.15, 5.9) -- (6.75, 5.9) -- (6.75, 4.2) -- (8, 4.2) -- (8, 0) -- cycle; + + \draw (0, 0) rectangle (8, 8); + \end{tikzpicture} + \end{column} + \begin{column}{.2\linewidth}\centering + \inline{hist(x)}\\x의 히스토그램. + \end{column}\hfill + \end{columns} +\end{seeblock} + +\begin{annotedblock}{날짜}{\textbf{lubridate} 패키지 참조} +\end{annotedblock} diff --git a/translations/korean/base-r_ko/thirdcolumn.tex b/translations/korean/base-r_ko/thirdcolumn.tex new file mode 100644 index 00000000..df108656 --- /dev/null +++ b/translations/korean/base-r_ko/thirdcolumn.tex @@ -0,0 +1,121 @@ +% !TEX root = base-r.tex + +\begin{block}{프로그래밍} + \vskip-2ex + \begin{columns}[t]\hfill\hfill\hfill + \begin{column}{.48\linewidth} + \begin{subblock}{For문} + \begin{code} + \begin{Pseudo} +for (variable in sequence) { + Do something +} + \end{Pseudo} + \end{code} + + \begin{exampleblock}{예시} + \begin{Rbg} +for (i in 1:4) { + j <- i + 10 + print(j) +} + \end{Rbg} + \end{exampleblock} + \end{subblock} + \begin{subblock}{If문} + \begin{code} + \begin{Pseudo} +if (condition) { + Do something +} else { + Do something +} + \end{Pseudo} + \end{code} + + \begin{exampleblock}{예시} + \begin{Rbg} +if (i > 3) { + print('Yes') +} else { + print('No') +} + \end{Rbg} + \end{exampleblock} + \end{subblock} + \end{column}\hfill + \begin{column}{.48\linewidth} + \begin{subblock}{While문} + + \begin{code} + \begin{Pseudo} +while (condition) { + Do something +} + \end{Pseudo} + \end{code} + + \begin{exampleblock}{예시} + + \begin{Rbg} +while (i < 5) { + print(i) + i <- i + 1 +} + \end{Rbg} + \end{exampleblock} + + \end{subblock} + + \begin{subblock}{함수} + \begin{code} + \begin{Pseudo} +funct_name <- function(var) { + Do something + return(new_variable) +} + \end{Pseudo} + \end{code} + + \begin{exampleblock}{예시} + + \begin{Rbg} +square <- function(x) { + squared <- x*x + return(squared) +} + \end{Rbg} + \end{exampleblock} + + \end{subblock} + \end{column}\hfill\hfill\hfill + \end{columns} + + \vskip-1.5ex + \begin{seesubblock}{데이터 입출력}{readr} + \vskip1ex + \begin{tableau}{| >{\color{black}\centering\small}m{0.27\linewidth} | >{\color{black}\centering\small}m{0.27\linewidth} | >{\color{black}\centering\arraybackslash}m{0.36\linewidth} |} + \hline + {\normalfont\textbf{입력}} & {\normalfont\textbf{출력}} & \textbf{설명}\\\hline + \rowcolor{secondary} \inl{df <- read.table('file.txt')} & \inl{write.table(df, 'file.txt')} & 구분 문자로 분리된 텍스트 파일 입출력\\\hline + \inl{df <- read.csv('file.csv')} & \inl{write.csv(df, 'file.csv')} & csv 파일 입출력 (\inl{read.table/write.table}의 특수한 경우)\\\hline + \rowcolor{secondary} \inl{load('file.RData')} & \inl{save(df, file = 'file.RData')} & R 데이터 파일 입출력\\\hline + \end{tableau} + \vskip-1ex + \end{seesubblock} + + \vskip1ex + \begin{subblock}{} + \small\hspace{0.25ex}\begin{beamercolorbox}[ht = 3.5ex, dp = 3ex, wd = 0.09\linewidth, center, rounded = true]{block title} + \textbf{\footnotesize 관계 연산자} + \end{beamercolorbox} + \hspace{1ex} + \footnotesize + \begin{tableau}{| >{\color{black}}c | >{\color{black}\cellcolor{secondary}}c | >{\color{black}}c | >{\color{black}\centering\cellcolor{secondary}}m{0.075\linewidth} | >{\color{black}}c | >{\color{black}\cellcolor{secondary}\centering\arraybackslash}m{0.1\linewidth} | >{\color{black}}c | >{\color{black}\cellcolor{secondary}}c |} + \hline + \inl{a == b} & 같다 & \inl{a > b} & 크다(초과) & \inl{a >= b} & 크거나 같다(이상) & \inl{is.na(a)} & 값이 없다\\\hline + \inl{a \!= b} & 같지 않다 & \inl{a < b} & 작다(미만) & \inl{a <= b} & 작거나 같다(이하) & \inl{is.null(a)} & 값이 null\\\hline + \end{tableau} + \vskip-1ex + \end{subblock} +\end{block} diff --git a/translations/korean/beamercolorthemeCS.sty b/translations/korean/beamercolorthemeCS.sty new file mode 100644 index 00000000..33c4da3b --- /dev/null +++ b/translations/korean/beamercolorthemeCS.sty @@ -0,0 +1,43 @@ +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{beamercolorthemeCS} + +\definecolor{secondary}{RGB}{237, 237, 238} +\definecolor{main}{RGB}{167, 170, 169} +\definecolor{darkgray}{RGB}{84, 88, 94} +\definecolor{blue}{RGB}{35, 78, 129} +\definecolor{tertiary}{RGB}{185, 207, 233} +\definecolor{green}{RGB}{59, 133, 56} +\definecolor{orange}{RGB}{209, 112, 46} +\definecolor{red}{RGB}{216, 54, 30} + +% Hyperlinks colors +\colorlet{linkcolor}{black} +\colorlet{citecolor}{blue} +\colorlet{filecolor}{blue} +\colorlet{urlcolor}{blue} + +% Code coloring +\colorlet{stringsty}{blue} +\colorlet{numbersty}{red} +\colorlet{identifiersty}{green} +\colorlet{namestyle}{blue} +\colorlet{condstyle}{red} +\colorlet{varstyle}{green} +\colorlet{loopstyle}{orange} +\colorlet{codebg}{blue} + + +\setbeamercolor{structure}{fg = white, bg = main} + +\setbeamercolor{block body}{fg = black, bg = secondary} +\setbeamercolor{title page}{fg = darkgray} +\setbeamerfont{title page}{size = \Huge} +\setbeamercolor{subtitle}{fg = darkgray} +\setbeamerfont{subtitle}{size = \Large} +\setbeamercolor{normal text}{fg = black, bg = white} + +\setbeamercolor{block body example}{fg = white, bg = codebg} +\setbeamercolor{block title example}{fg = main} +\setbeamerfont{block title example}{series = \bf} + +\setbeamercolor{alerted text}{fg = black, bg = tertiary} diff --git a/translations/korean/beamerthemeCS.sty b/translations/korean/beamerthemeCS.sty new file mode 100644 index 00000000..19586500 --- /dev/null +++ b/translations/korean/beamerthemeCS.sty @@ -0,0 +1,329 @@ + +\ProvidesPackage{beamerthemeCS} + +\usepackage{graphicx, colortbl} +\usepackage{ifthen, multirow} + +\usecolortheme{CS} + +\def\bleu#1{\textcolor{bleu}{#1}} +\def\br{\\\vskip2ex} + +\usepackage{textcomp} + +\usepackage{hyperref, xspace} +\hypersetup{ + pdfcreator = {LaTeX with hyperref package}, + pdfproducer = {pdflatex}, + colorlinks = true, % false: boxed links; true: colored links + linkcolor = linkcolor, % color of internal links (change box color with linkbordercolor) + citecolor = citecolor, % color of links to bibliography + filecolor = filecolor, % color of file links + urlcolor = urlcolor % color of external links +} + +\usepackage{listings} + +\lstdefinelanguage[myR]{R}[]{R}{ + morekeywords = {str}, + sensitive = false +} + +\lstdefinestyle{codeR}{ + basicstyle = \ttfamily, + mathescape = true, + aboveskip = 0pt, + breaklines = true, + language = [myR]R, + stringstyle = \color{stringsty}, + showstringspaces = false +} + +\lstnewenvironment{R} + {\lstset{style=codeR, upquote=true}} + {} + +\lstdefinestyle{codeRbg}{ + basicstyle = \ttfamily, + mathescape = true, + aboveskip = 0pt, + breaklines = true, + language = [myR]R, + keywordstyle = \mdseries, + numberstyle = \mdseries, + stringstyle = \mdseries, + showstringspaces = false, + lineskip = 0.35ex, + xleftmargin = 0.5ex, + xrightmargin = 0.5ex +} + +\lstdefinestyle{codeRc}{ + basicstyle = \ttfamily, + aboveskip = 0pt, + breaklines = true, + language = [myR]R, + keywordstyle = \mdseries, + identifierstyle = \color{identifiersty}, + stringstyle = \color{stringsty}, + showstringspaces = false, + xleftmargin = 0.5ex, + xrightmargin = 0.5ex, + literate = + *{0}{{{\color{numbersty}0}}}1 + {1}{{{\color{numbersty}1}}}1 + {2}{{{\color{numbersty}2}}}1 + {3}{{{\color{numbersty}3}}}1 + {4}{{{\color{numbersty}4}}}1 + {5}{{{\color{numbersty}5}}}1 + {6}{{{\color{numbersty}6}}}1 + {7}{{{\color{numbersty}7}}}1 + {8}{{{\color{numbersty}8}}}1 + {9}{{{\color{numbersty}9}}}1 +} + +\lstnewenvironment{Rbg} + {\lstset{style=codeRbg, upquote=true}} + {} + +\lstset{ + literate={~} {\scriptsize$\,\sim\,$}{1} +} + +\def\inline#1{\lstinline[style=codeR, upquote=true]!#1!} +\def\inl#1{\lstinline[style=codeRbg, upquote=true]!#1!} +\def\inlc#1{\lstinline[style=codeRc, upquote=true]!#1!} + + +\lstdefinelanguage{pseudo}{ + classoffset = 0, + morekeywords = {variable, function_name, funct_name}, + keywordstyle = \color{namestyle}, + classoffset = 1, + morekeywords = {condition}, + keywordstyle = \color{condstyle}, + classoffset = 2, + morekeywords = {sequence, var, new_variable}, + keywordstyle = \color{varstyle}, + classoffset = 3, + morekeywords = {Do, something, different}, + keywordstyle = \color{loopstyle}, + classoffset=0, + sensitive = false, + morecomment = [l]{//}, + morecomment = [s]{/*}{*/}, + morestring = [b]", + morestring = [d]' +} + +\lstdefinestyle{codePseudo}{ + basicstyle = \ttfamily, + mathescape=true, + aboveskip = 0pt, + breaklines = true, + language = pseudo, + showstringspaces = false, + lineskip = 0.35ex, + xleftmargin = 0.5ex, + xrightmargin = 0.5ex +} + +\lstnewenvironment{Pseudo} + {\lstset{style=codePseudo, upquote=true}} + {} + +\defbeamertemplate*{title page}{customized}[1][]{ + \centering\vskip0.1ex + \textbf{\inserttitle}\par\vskip-0.25ex + {\usebeamerfont{subtitle} \insertsubtitle\par} + \vskip0.75ex +} + + +\usepackage{calc} +\newlength{\longueur} +\newlength{\tmp} + +\newenvironment{tableau}[1]{ + \color{gray}\begin{tabular}[b]{#1} +}{ + \end{tabular} +} + +%%%%%%%%%%%%%%%%%%%% +%%%%% Définition des blocks %%%% +%%%%%%%%%%%%%%%%%%%% +\setbeamertemplate{block begin}{ + \setlength{\longueur}{\linewidth-2ex} + \begin{beamercolorbox}[rounded = true, wd = \linewidth, leftskip = 1ex, rightskip = 1ex, vmode]{block body} + \vskip-.5ex + \setlength{\linewidth}{\longueur} + + \hfill + \begin{beamercolorbox}[ht = 1.25ex, dp = 0.2ex, wd = \longueur, center, rounded = true]{block title} + \textbf{\Large \insertblocktitle} + \end{beamercolorbox} + \ifbeamercolorempty[bg]{block title}{} + + \vskip.5ex + \usebeamerfont{block body} +} +\setbeamertemplate{block end}{ + \end{beamercolorbox}\par + \vskip1ex + \setlength{\linewidth}{\longueur+2ex} +} + + +%%%%% Sous-titre dans un block %%%%% +\def\blocksubtitle#1{ + \vskip0.5ex + \setlength{\longueur}{\linewidth-2ex} + + \hfill + \begin{beamercolorbox}[ht = 0.75ex, dp = 0.ex, wd = \longueur, center, rounded = true]{block title} + #1 + \end{beamercolorbox} + \hfill\hfill + + \vskip0.5ex +} + + +%%%%% Sous block %%%%% +\newenvironment{subblock}[1]{ + \setlength{\longueur}{\linewidth-2ex} + + \hfill\hfill + \begin{beamercolorbox}[rounded = true, wd = \linewidth, sep=1ex]{normal text} + \vskip-1.5ex + \setlength{\linewidth}{\longueur} + + \ifthenelse{\equal{#1}{}}{}{ + \hfill + \begin{beamercolorbox}[ht = 1ex, dp = 0.ex, wd = \longueur, center, rounded = true]{block title} + \textbf{\large #1} + \end{beamercolorbox} + + \vskip0.2ex + }} + { + \vskip-0.75ex + \end{beamercolorbox} + \hfill\hfill\hfill + + \vskip-1.25ex + \setlength{\linewidth}{\longueur+2ex}} + + +%%%%% Block annoté %%%%% +\newenvironment{annotedblock}[2]{ + \setlength{\longueur}{\linewidth-2ex} + + \hfill\hfill + \begin{beamercolorbox}[rounded = true, wd = \linewidth, sep=1ex]{block body} + \vskip-1.5ex + \setlength{\linewidth}{\longueur} + + \hspace{-0.5ex} + \begin{beamercolorbox}[ht = 1.25ex, dp = 0.2ex, wd = 0.43\longueur, center, rounded = true]{block title} + \textbf{\Large #1} + \end{beamercolorbox} + \hfill + \begin{beamercolorbox}[ht = 1ex, dp = 0.ex, wd = 0.52\longueur, center, rounded = true]{alerted text} + #2 + \end{beamercolorbox} + \hspace{-0.5ex} + + \vskip0.2ex + } + {\end{beamercolorbox} + +% \vskip-2ex + \setlength{\linewidth}{\longueur+2ex}} + +\newenvironment{seeblock}[2]{ + \begin{annotedblock}{#1}{\textbf{#2} 패키지 참조}} + {\end{annotedblock}} + + +\newenvironment{annotedsubblock}[2]{ + \setlength{\longueur}{\linewidth-2ex} + + \hfill\hfill + \begin{beamercolorbox}[rounded = true, wd = \linewidth, sep=1ex]{normal text} + \vskip-1.5ex + \setlength{\linewidth}{\longueur} + + \hspace{-0.5ex} + \begin{beamercolorbox}[ht = 1.25ex, dp = 0.ex, wd = 0.6\longueur, center, rounded = true]{block title} + \textbf{\large #1} + \end{beamercolorbox} + \hfill + \begin{beamercolorbox}[ht = 1ex, dp = 0.ex, wd = 0.37\longueur, center, rounded = true]{alerted text} + #2 + \end{beamercolorbox} + \hspace{-0.5ex} + + \vskip0.2ex + } + {\end{beamercolorbox} + +% \vskip-2ex + \setlength{\linewidth}{\longueur+2ex}} + + +\newenvironment{seesubblock}[2]{ + \begin{annotedsubblock}{#1}{\textbf{#2} 패키지 참조}} + {\end{annotedsubblock}} + + + + +%%%%%%%%%%%%%%%%%%%% +%%%% Définition des exemples %%% +%%%%%%%%%%%%%%%%%%%% +\setbeamertemplate{block example begin}{ + \begin{beamercolorbox}[ht = 1.25ex, dp = 0.5ex, wd = \linewidth, center, rounded = true]{block title example} + \usebeamerfont{block title example}\insertblocktitle + \end{beamercolorbox} + + \begin{beamercolorbox}[wd = \linewidth, dp = 0.5ex, leftskip = 1ex, rightskip = 1ex, vmode]{block body example} + \vskip0.ex +} +\setbeamertemplate{block example end}{ + \vskip-1.5ex + \end{beamercolorbox} +} + + + +\newenvironment{code}{ + \setlength{\longueur}{\linewidth-0.3ex} + \begin{beamercolorbox}[wd = \linewidth, dp = 0.4ex, leftskip = 0.15ex, rightskip = 0.15ex, vmode]{block title} + + \setlength{\linewidth}{\longueur} + \vskip0.15ex + + \begin{beamercolorbox}[wd = \longueur, dp = 0.5ex, leftskip = 1ex, rightskip = 1ex, vmode]{normal text} + \vskip0.ex +}{ + \vskip-1.5ex + \end{beamercolorbox} + \setlength{\linewidth}{\longueur+0.3ex} + \vskip-0.25ex + \end{beamercolorbox} +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\setbeamertemplate{headline}{} +\setbeamertemplate{footline}{\small \hskip3ex RStudio\textregistered\xspace is a trademark of RStudio, Inc. \textbullet\xspace \href{https://creativecommons.org/licenses/by/4.0/}{CC BY} Mhairi McNeill \textbullet\xspace \url{mhairihmcneill@gmail.com} \hfill Translation by Taeho Kim \textbullet\xspace \url{thkim0560@kaist.ac.kr} \textbullet\xspace package version \textbullet\xspace Updated: 3/15\hspace{3ex} \vskip1ex} +\setbeamertemplate{navigation symbols}{} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Display a grid to help align images ... and it looks nice with this color scheme +% \beamertemplategridbackground[1cm] + +%Some beamer customizations: +\setbeamertemplate{bibliography item}[text] +\setbeamertemplate{caption}[numbered]{}% Number float-like environments