Skip to content

Commit

Permalink
Merge pull request #263 from taehokimmm/main
Browse files Browse the repository at this point in the history
Korean translation for the base-r cheatsheet
  • Loading branch information
mine-cetinkaya-rundel authored May 2, 2024
2 parents 414da42 + bd977e3 commit e096cb4
Show file tree
Hide file tree
Showing 11 changed files with 1,045 additions and 0 deletions.
Binary file added translations/korean/base-r_ko.pdf
Binary file not shown.
76 changes: 76 additions & 0 deletions translations/korean/base-r_ko/base-r_ko.tex
Original file line number Diff line number Diff line change
@@ -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}
217 changes: 217 additions & 0 deletions translations/korean/base-r_ko/fifthcolumn.tex
Original file line number Diff line number Diff line change
@@ -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}
}
26 changes: 26 additions & 0 deletions translations/korean/base-r_ko/firstcolumn.tex
Original file line number Diff line number Diff line change
@@ -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}
64 changes: 64 additions & 0 deletions translations/korean/base-r_ko/fourthcolumn.tex
Original file line number Diff line number Diff line change
@@ -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}
Loading

0 comments on commit e096cb4

Please sign in to comment.