Skip to content

Commit e096cb4

Browse files
Merge pull request #263 from taehokimmm/main
Korean translation for the base-r cheatsheet
2 parents 414da42 + bd977e3 commit e096cb4

File tree

11 files changed

+1045
-0
lines changed

11 files changed

+1045
-0
lines changed

translations/korean/base-r_ko.pdf

1.1 MB
Binary file not shown.
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
\documentclass[final,hyperref={pdfpagelabels=false}]{beamer}
2+
3+
\usepackage{macros}
4+
5+
\usefolder{../}
6+
\usetheme{CS}
7+
8+
%%%%%% To change the theme color, uncomment the following lines and set your own color. %%%%%%
9+
%%%%%%%% You can also directly modify the colors in the file beamercolorthemeCS.sty %%%%%%%%
10+
%
11+
%\definecolor{mycolor}{rgb}{0.8, 0, 0.4}
12+
%\definecolor{mycodecolor}{rgb}{0.4, 0.6, 0.8}
13+
%\colorlet{codebg}{mycodecolor}
14+
%
15+
%\setbeamercolor{structure}{bg = mycolor}
16+
%\setbeamercolor{title page}{fg = mycolor}
17+
%\setbeamercolor{alerted text}{fg = mycolor, bg = main}
18+
%\setbeamercolor{block title example}{fg = mycolor}
19+
20+
\usepackage{times}
21+
\usepackage{amsmath,amsthm, amssymb, latexsym}
22+
\boldmath
23+
\usepackage[english]{babel}
24+
\usepackage{kotex}
25+
\usepackage[orientation=landscale, size=a4, scale=1.5, debug]{beamerposter}
26+
27+
\usepackage{tikz}
28+
\usetikzlibrary{arrows}
29+
30+
\def\q{\textquotesingle}
31+
32+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
33+
\graphicspath{{figures/}}
34+
35+
\title{Base R}
36+
\subtitle{Cheatsheet}
37+
38+
39+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
40+
\begin{document}
41+
42+
\begin{frame}[fragile]{}
43+
\vfill
44+
\begin{columns}[t]
45+
\begin{column}{.25\linewidth}
46+
\maketitle
47+
\input{firstcolumn}
48+
\end{column}
49+
50+
\begin{column}{.25\linewidth}
51+
\input{secondcolumn}
52+
\end{column}
53+
54+
\begin{column}{.50\linewidth}
55+
\input{thirdcolumn}
56+
\end{column}
57+
\end{columns}
58+
\vfill
59+
\end{frame}
60+
61+
\begin{frame}[fragile]{}
62+
\begin{columns}[t]
63+
\begin{column}{0.33\linewidth}
64+
\input{fourthcolumn}
65+
\end{column}
66+
67+
\begin{column}{0.33\linewidth}
68+
\input{fifthcolumn}
69+
\end{column}
70+
71+
\begin{column}{0.33\linewidth}
72+
\input{sixthcolumn}
73+
\end{column}
74+
\end{columns}
75+
\end{frame}
76+
\end{document}
Lines changed: 217 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,217 @@
1+
% !TEX root = base-r.tex
2+
3+
{\setbeamercolor{block body}{fg = black, bg = white}
4+
\begin{block}{리스트}
5+
\centering
6+
\inlc{l <- list(x = 1:5, y = c('a', 'b'))}\\{\small 리스트는 자료형에 상관없이 여러 개의 원소를 가지는 집합}
7+
8+
\smallskip
9+
{\color{gray}\hrule}
10+
11+
\smallskip
12+
\begin{tabular}{*{4}{>{\centering\arraybackslash}m{0.215\linewidth}}}
13+
\inlc{l[[2]]} & \inlc{l[1]} & \inlc{l\$x} & \inlc{l['y']}\\
14+
l의 두번째 원소 & 첫 번째 원소만 있는 새 리스트 & x라는 이름의 원소 & y라는 이름의 원소만 있는 새 리스트.
15+
\end{tabular}
16+
\end{block}
17+
}
18+
19+
\begin{block}{행렬}
20+
\begin{column}[t]{0.5\linewidth}
21+
\begin{tabular}{>{\centering\arraybackslash} m{0.65cm} c @{-~~} l}
22+
\begin{tikzpicture}[scale = 0.3]
23+
\foreach \x in {0, 1, 2}
24+
\foreach \y in {0, 2}
25+
\filldraw[lightgray!65] (\x, \y) rectangle ({\x + 0.8}, {\y + 0.8});
26+
\foreach \x in {0, 1, 2}
27+
\filldraw[yellow!75!orange] (\x, 1) rectangle ({\x + 0.8}, {1 + 0.8});
28+
\end{tikzpicture}
29+
& \inlc{m[2, ]} & 열 선택\\
30+
\begin{tikzpicture}[scale = 0.3]
31+
\foreach \y in {0, 1, 2}
32+
\foreach \x in {1, 2}
33+
\filldraw[lightgray!65] (\x, \y) rectangle ({\x + 0.8}, {\y + 0.8});
34+
\foreach \y in {0, 1, 2}
35+
\filldraw[yellow!75!orange] (0, \y) rectangle ({0 + 0.8}, {\y + 0.8});
36+
\end{tikzpicture}
37+
& \inlc{m[ ,1]} & 행 선택\\
38+
\begin{tikzpicture}[scale = 0.3]
39+
\foreach \x in {0, 1, 2}
40+
\foreach \y in {0, 1, 2}
41+
\filldraw[lightgray!65] (\x, \y) rectangle ({\x + 0.8}, {\y + 0.8});
42+
\filldraw[yellow!75!orange] (2, 1) rectangle ({2 + 0.8}, {1 + 0.8});
43+
\end{tikzpicture}
44+
& \inlc{m[2,3]} & 원소 선택
45+
\end{tabular}
46+
\end{column}
47+
{\color{gray}\vrule}
48+
\begin{column}[t]{0.35\linewidth}
49+
\vspace{-10ex}
50+
\flushright
51+
\inl{t(m)}\\ 전치
52+
53+
\inl{m \%*\% n}\\{ 행렬곱}
54+
55+
\inl{solve(m,n)}\\{ \inl{m*x = n}의 해 찾기}
56+
\end{column}
57+
\end{block}
58+
59+
{\setbeamercolor{block body}{fg = black, bg = white}
60+
\begin{seeblock}{데이터프레임}{dplyr}
61+
{\fontsize{9pt}{11pt}\selectfont\inlc{df <- data.frame(x = 1:3, y = c('a', 'b', 'c'))}\\모든 원소의 길이가 같은 리스트의 특수한 케이스}
62+
63+
\begin{column}{0.35\linewidth}
64+
65+
\renewcommand{\arraystretch}{1.75}
66+
\color{secondary}
67+
\begin{tabular}{| >{\centering\arraybackslash\color{black}} m{0.75cm} | >{\centering\arraybackslash\color{black}} m{0.75cm} |}
68+
\hline
69+
\rowcolor{codebg}\color{white} x & \color{white}y\\\hline
70+
\rowcolor{white} 1 & a\\\hline
71+
\rowcolor{white} 2 & b\\\hline
72+
\rowcolor{white} 3 & c\\\hline
73+
\end{tabular}
74+
\end{column}
75+
%
76+
\begin{column}{0.65\linewidth}
77+
\vspace{-3ex}
78+
\begin{center}\textbf{리스트로 자르기}\end{center}
79+
\begin{tabular}{c >{\centering\arraybackslash} m{0.65cm} c m{0.65cm}}
80+
\inlc{df\$x} &
81+
\begin{tikzpicture}[xscale = 0.4, yscale = 0.3]
82+
\foreach \y in {0, 1, 2}
83+
\filldraw[yellow!75!orange] (0, \y) rectangle ({0 + 0.8}, {\y + 0.8});
84+
\filldraw[yellow!70!black] (0, 3) rectangle ({0 + 0.8}, {3 + 0.8});
85+
\foreach \y in {0, 1, 2}
86+
\filldraw[white] (1, \y) rectangle ({1 + 0.8}, {\y + 0.8});
87+
\filldraw[codebg] (1, 3) rectangle ({1 + 0.8}, {3 + 0.8});
88+
\end{tikzpicture} &
89+
\inlc{df[[2]]} &
90+
\begin{tikzpicture}[xscale = 0.4, yscale = 0.3]
91+
\foreach \y in {0, 1, 2}
92+
\filldraw[yellow!75!orange] (1, \y) rectangle ({1 + 0.8}, {\y + 0.8});
93+
\filldraw[yellow!70!black] (1, 3) rectangle ({1 + 0.8}, {3 + 0.8});
94+
\foreach \y in {0, 1, 2}
95+
\filldraw[white] (0, \y) rectangle ({0 + 0.8}, {\y + 0.8});
96+
\filldraw[codebg] (0, 3) rectangle ({0 + 0.8}, {3 + 0.8});
97+
\end{tikzpicture}
98+
\end{tabular}
99+
\vspace{-1.5ex}
100+
\begin{center}
101+
\begin{tikzpicture}[remember picture, overlay]
102+
\draw[darkgray, dotted, very thick, rounded corners] (-3, 0) rectangle (3, -1.5);
103+
\end{tikzpicture}
104+
105+
\textit{데이터프레임 파악하기}
106+
107+
\smallskip
108+
\begin{tabular}{c l}
109+
\inl{view(df)} & 전체 데이터프레임 보기\\
110+
\inl{head(df)} & 첫 6열까지만 보기
111+
\end{tabular}
112+
\end{center}
113+
\end{column}
114+
115+
\bigskip
116+
\textbf{행렬로 자르기}
117+
118+
\medskip
119+
\begin{column}{0.33\linewidth}
120+
\begin{tabular}{c >{\centering\arraybackslash} m{0.65cm}}
121+
\inlc{df[ ,2]} &
122+
\begin{tikzpicture}[xscale = 0.4, yscale = 0.3]
123+
\foreach \y in {0, 1, 2}
124+
\filldraw[yellow!70!orange] (1, \y) rectangle ({1 + 0.8}, {\y + 0.8});
125+
\filldraw[yellow!75!black] (1, 3) rectangle ({1 + 0.8}, {3 + 0.8});
126+
\foreach \y in {0, 1, 2}
127+
\filldraw[white] (0, \y) rectangle ({0 + 0.8}, {\y + 0.8});
128+
\filldraw[codebg] (0, 3) rectangle ({0 + 0.8}, {3 + 0.8});
129+
\end{tikzpicture}\\[0.75ex]
130+
\inlc{df[2, ]} &
131+
\begin{tikzpicture}[xscale = 0.4, yscale = 0.3]
132+
\foreach \x in {0, 1} {
133+
\filldraw[codebg] (\x, 3) rectangle ({\x + 0.8}, {3 + 0.8});
134+
\filldraw[white] (\x, 0) rectangle ({\x + 0.8}, {0 + 0.8});
135+
\filldraw[white] (\x, 2) rectangle ({\x + 0.8}, {2 + 0.8});
136+
\filldraw[yellow!75!orange] (\x, 1) rectangle ({\x + 0.8}, {1 + 0.8});
137+
}
138+
\end{tikzpicture}\\[0.75ex]
139+
\inlc{df[2,2]} &
140+
\begin{tikzpicture}[xscale = 0.4, yscale = 0.3]
141+
\foreach \x in {0, 1} {
142+
\filldraw[codebg] (\x, 3) rectangle ({\x + 0.8}, {3 + 0.8});
143+
\foreach \y in {0, 1, 2}
144+
\filldraw[white] (\x, \y) rectangle ({\x + 0.8}, {\y + 0.8});
145+
}
146+
\filldraw[yellow!75!orange] (1, 1) rectangle ({1 + 0.8}, {1 + 0.8});
147+
\end{tikzpicture}\\
148+
\end{tabular}
149+
\end{column}
150+
{\color{gray}{\vrule}}
151+
\begin{column}{0.24\linewidth}
152+
\vspace{-13ex}
153+
154+
\inl{nrow(df)}\\열 개수
155+
156+
\inl{ncol(df)}\\행 개수
157+
158+
\inl{dim(df)}\\행과 열의 개수
159+
\end{column}
160+
{\color{gray}{\vrule}}
161+
\begin{column}{0.4\linewidth}
162+
\vspace{-12ex}
163+
164+
\inl{cbind} - 열로 합치기
165+
166+
\smallskip
167+
{\centering
168+
\begin{tikzpicture}[xscale = 0.4, yscale = 0.3]
169+
\foreach \x in {0, 1} {
170+
\filldraw[codebg] (\x, 3) rectangle ({\x + 0.8}, {3 + 0.8});
171+
\foreach \y in {0, 1, 2}
172+
\filldraw[white] (\x, \y) rectangle ({\x + 0.8}, {\y + 0.8});
173+
}
174+
175+
\foreach \y in {0, 1, 2}
176+
\filldraw[red] (2.5, \y) rectangle ({2.5 + 0.8}, {\y + 0.8});
177+
\filldraw[red!70!black] (2.5, 3) rectangle ({2.5 + 0.8}, {3 + 0.8});
178+
179+
\draw[->, > = stealth', ultra thick, main] (3.75, 1.5) -- (5.35, 1.5);
180+
181+
\foreach \x in {6, 7, 8} {
182+
\foreach \y in {0, 1, 2}
183+
\filldraw[green] (\x, \y) rectangle ({\x + 0.8}, {\y + 0.8});
184+
\filldraw[green!70!black] (\x, 3) rectangle ({\x + 0.8}, {3 + 0.8});
185+
}
186+
\end{tikzpicture}}
187+
188+
\smallskip
189+
\inl{rbind} - 행으로 합치기
190+
191+
\smallskip
192+
{\centering
193+
\begin{tikzpicture}[xscale = 0.4, yscale = 0.3]
194+
\foreach \x in {0, 1} {
195+
\filldraw[codebg] (\x, 3) rectangle ({\x + 0.8}, {3 + 0.8});
196+
\foreach \y in {0, 1, 2}
197+
\filldraw[white] (\x, \y) rectangle ({\x + 0.8}, {\y + 0.8});
198+
}
199+
200+
\foreach \x in {2.5, 3.5} {
201+
\filldraw[red] (\x, 1) rectangle ({\x + 0.8}, {1 + 0.8});
202+
\filldraw[red!70!black] (\x, 2) rectangle ({\x + 0.8}, {2 + 0.8});
203+
}
204+
205+
\draw[->, > = stealth', ultra thick, main] (4.75, 1.5) -- (6.35, 1.5);
206+
207+
\foreach \x in {7, 8} {
208+
\foreach \y in {-0.5, 0.5, 1.5, 2.5}
209+
\filldraw[green] (\x, \y) rectangle ({\x + 0.8}, {\y + 0.8});
210+
\filldraw[green!70!black] (\x, 3.5) rectangle ({\x + 0.8}, {3.5 + 0.8});
211+
}
212+
213+
\end{tikzpicture}}
214+
215+
\end{column}
216+
\end{seeblock}
217+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
% !TEX root = base-r.tex
2+
3+
\begin{block}{사용법 도움받기}
4+
5+
\blocksubtitle{매뉴얼 보기}
6+
\inline{?mean}\\특정 함수에 대한 도움 받기\br
7+
\inline{help.search('weighted mean')}\\특정 단어나 문구에 대한 사용법 찾기\br
8+
\inline{help(package = 'dplyr')}\\패키지 사용법 찾기
9+
10+
\blocksubtitle{오브젝트 정보 더보기}
11+
\inline{str(iris)}\\오브젝트의 구조에 대한 요약 보기\br
12+
\inline{class(iris)}\\오브젝트가 소속된 클래스 찾기
13+
\end{block}
14+
15+
\begin{block}{패키지 사용하기}
16+
\inline{install.packages('dplyr')}\\CRAN에서 패키지를 다운로드하고 설치\br
17+
\inline{library(dplyr)}\\세션에 패키지 불러오기\br
18+
\inline{dplyr::select}\\패키지에서 특정 함수 사용\br
19+
\inline{data(iris)}\\내장 데이터셋을 environment에 불러오기
20+
\end{block}
21+
22+
\begin{block}{작업 디렉토리}
23+
\inline{getwd()}\\현재 작업 디렉토리 찾기\br
24+
\inline{setwd('C://file/path')}\\현재 작업 디렉토리 변경\br
25+
\textbf{RStudio의 project를 사용해 작업 디렉토리를 현재 폴더로 변경할 수 있음}
26+
\end{block}
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
% !TEX root = base-r.tex
2+
3+
\begin{block}{자료형}
4+
\vspace{1ex}
5+
6+
\centering
7+
\begin{minipage}{0.8\linewidth}
8+
\centering
9+
자주 쓰는 자료형간의 변환. 표 아래쪽의 값에서 위쪽의 값으로는 항상 변환 가능하다.
10+
\end{minipage}
11+
12+
\vspace{1ex}
13+
14+
\small\renewcommand{\arraystretch}{1.3}
15+
\begin{tableau}{>{\color{black}}l | >{\color{darkgray}}m{0.31\linewidth} | >{\color{black}\centering\arraybackslash}m{0.35\linewidth}}
16+
\inl{as.logical} & \inl{TRUE, FALSE, TRUE} & Boolean 값 (참 아니면 거짓)\\
17+
\inl{as.numeric} & \inl{1, 0, 1} & 정수나 실수\\
18+
\inl{as.character} & \inl{'1', '0', '1'} & 문자열. 팩터에서 자주 사용함\\
19+
\inl{as.factor} & \inl{'1', '0', '1'}\qquad\inl{levels: '1', '0'} & level이 정해진 문자열. 몇몇 통계모델에 필요함\\
20+
\end{tableau}
21+
22+
\end{block}
23+
24+
{\setbeamercolor{block body}{fg = black, bg = white}
25+
\begin{block}{수학 함수}
26+
\small\renewcommand{\arraystretch}{1.3}
27+
\begin{tabular}{r m{0.25\linewidth} r m{0.25\linewidth}}
28+
\inl{log(x)} & 자연로그 & \inl{sum(x)} & 합\\
29+
\inl{exp(x)} & 지수함수 & \inl{mean(x)} & 평균\\
30+
\inl{max(x)} & 최댓값 & \inl{median(x)} & 중앙값\\
31+
\inl{min(x)} & 최솟값 & \inl{quantile(x)} & 사분위수\\
32+
\inl{(x, n)} & 소수점 n째자리까지 반올림 & \inl{rank(x)} & 원소의 큰 순서\\
33+
\inl{(x, n)} & 유효숫자 n자리 & \inl{var(x)} & 분산\\
34+
\inl{(x, y)} & 상관계수 & \inl{sd(x)} & 표준편차.
35+
\end{tabular}
36+
\end{block}
37+
}
38+
39+
\begin{block}{변수 할당}
40+
\begin{code}
41+
\begin{Pseudo}
42+
> a <- 'apple'
43+
> a
44+
[1] 'apple'
45+
\end{Pseudo}
46+
\end{code}
47+
\end{block}
48+
49+
\begin{block}{Environment}
50+
\renewcommand{\arraystretch}{1.3}
51+
\begin{tabular}{l m{0.6\linewidth}}
52+
\inline{ls()} & environment의 모든 변수 나열\\
53+
\inline{rm(x)} & environment에서 x 제거\\
54+
\inline{rm(list = ls())} & environment에서 모든 변수 제거
55+
\end{tabular}
56+
57+
\vspace{1ex}
58+
59+
\centering
60+
\begin{minipage}{0.8\linewidth}
61+
\centering
62+
\textbf{RStudio의 environment 패널로 environment의 변수들을 볼 수 있음}
63+
\end{minipage}
64+
\end{block}

0 commit comments

Comments
 (0)