Skip to content

Instantly share code, notes, and snippets.

@dialektike
Last active March 6, 2017 08:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dialektike/9c1d72f71d6a275d45d6df99241dfada to your computer and use it in GitHub Desktop.
Save dialektike/9c1d72f71d6a275d45d6df99241dfada to your computer and use it in GitHub Desktop.
구글 R 스타일 가이드(Google's R Style Guide) 번역
<?xml version="1.0"?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link rel="stylesheet" type="text/css" href="styleguide.css"/>
<title>Google's R Style Guide</title>
</head>
<body>
<!-- <h1>Google's R Style Guide</h1> -->
<h1>구글 R 스타일 가이드(Google's R Style Guide)</h1>
<!-- <p>
R is a high-level programming language used primarily for
statistical computing and graphics. The goal of the R
Programming Style Guide is to make our R code easier to read,
share, and verify. The rules below were designed in
collaboration with the entire R user community at Google.
</p> -->
<p>
R은 주로 통계 계산 및 그래픽에 사용되는 고급 프로그래밍 언어입니다.
이 R 프로그래밍 스타일 가이드의 목표는 R 코드를 더 쉽게 읽고,
공유하고 그리고 확인하도록 만드는 것입니다.
아래 규칙은 Google의 전체 R 사용자 커뮤니티와 공동으로 설계되었습니다.
</p>
<h2>Summary: R Style Rules</h2>
<ol>
<!-- <li><a href="#filenames">File Names</a>: end in <code>.R</code></li> -->
<li><a href="#filenames">파일 이름</a>: 마지막에 <code>.R</code>를 넣자.</li>
<li><a href="#identifiers">식별자(identifiers)</a>: <code>variable.name</code>
(or <code>variableName</code>),
<code>FunctionName</code>, <code>kConstantName</code></li>
<li><a href="#linelength">줄 길이(Line Length)</a>: <!-- maximum 80 characters --> 최대 80 글자</li>
<li><a href="#indentation">들여 쓰기(Indentation)</a>: <!-- two spaces, no tabs --> 탭 쓰지 말고, 2 스페이스</li>
<li><a href="#spacing">공백 넣기(Spacing)</a></li>
<li><a href="#curlybraces">중괄호(Curly Braces)</a>: <!-- first on same line, last on own line --> </li>
<li><a href="#else">else</a>: Surround else with braces </li>
<li><a href="#assignment">할당(Assignment)</a>: <!-- use <code>&lt;-</code>, not
<code>=</code> -->
<code>&lt;-</code>을 사용하고,
<code>=</code>는 사용하지 마세요.</li>
<li><a href="#semicolons">세미콜론(Semicolons)</a>: <!-- don't use them --> 이것을 사용하지 마세요.</li>
<li><a href="#generallayout"> 일반적인 레이아웃과 순서(General Layout and Ordering)</a></li>
<li><a href="#comments"> 주석 달기 지침(Commenting Guidelines)</a>: <!-- all comments begin
with <code>#</code> followed by a space; inline comments need two
spaces before the <code>#</code> -->
모든 주석은 공백 한 칸(a space)이 딸려 있는 <code>#</code>으로
시작합니다; 인라인(inline) 주석은 <code>#</code> 앞에 공백 2 칸이
필요합니다.</li>
<li><a href="#functiondefinition"> 함수 정의와 호출(Function Definitions and Calls)</a></li>
<li><a href="#functiondocumentation"> 함수 문서화(Function Documentation)</a></li>
<li><a href="#examplefunction"> Example Function</a></li>
<li><a href="#todo"> TODO Style</a>: <code>TODO(username)</code></li>
</ol>
<h2>Summary: R Language Rules</h2>
<ol>
<li><a href="#attach"> <code>attach</code></a>: <!-- avoid using it --> 이것을 사용하지 마세요.</li>
<li><a href="#functionlanguage"> Functions</a>:
<!-- errors should be raised using <code>stop()</code></li> --> <code>stop()</code>을 사용할 때에는 에러가 발생하게 해야 합니다.</li>
<li><a href="#object"> Objects and Methods</a>: <!-- avoid S4 objects and
methods when possible; never mix S3 and S4 -->
가능한 한 S4 객체와 메소드는 피하세요; 절대로 S3와 S4를 섞지 마세요</li>
</ol>
<h3>Notation and Naming</h3>
<h4 id="filenames">파일 이름(File Names)</h4>
<!-- <p>
File names should end in <code>.R</code> and, of course, be
meaningful.
<br/> GOOD: <code>predict_ad_revenue.R</code>
<br/> BAD: <code><span style="color:red">foo.R</span></code>
</p> -->
<p>
파일 이름은 <code>.R</code>으로 끝나야 하고,
의미가 있어야 한다.
<br/> GOOD: <code>predict_ad_revenue.R</code>
<br/> BAD: <code><span style="color:red">foo.R</span></code>
</p>
<h4 id="identifiers">식별자(Identifiers)</h4>
<!-- <p>
Don't use underscores ( <code>_</code> ) or hyphens
( <code>-</code> ) in identifiers.
Identifiers should be named according to the following conventions.
The preferred form for variable names is all lower case
letters and words separated with dots
(<code>variable.name</code>), but <code>variableName</code>
is also accepted;
function names have initial capital letters and no dots
(<code>FunctionName</code>);
constants are named like functions but with an initial
<code>k</code>.
</p> -->
<p>
식별자(identifiers)안에는 밑줄 ( <code>_</code> )이나 하이픈 ( <code>-</code> )을 사용하지 마십시오.
식별자는 다음 규칙에 따라 이름을 붙여야 합니다.
변수(variable) 이름으로 선호되는 형식은 모두 소문자이고
점으로 구분된 단어 (<code>variable.name</code>) 이지만, <code>variableName</code> 도 허용합니다;
함수 이름 맨 앞글자는 대문자로 하고 점이 없이 (<code>FunctionName</code>) 과 같이 정합니다;
상수(constants)에는 함수처럼 이름을 붙이지만
맨 앞에 <code>k</code>라는 이니셜을 붙입니다.
</p>
<ul>
<!-- <li><code>variable.name</code> is preferred, -->
<li><code>variable.name</code>을 선호하지만, <!-- <code>variableName</code> is accepted -->
<code>variableName</code> 도 받아드립니다.
<br/> GOOD: <code>avg.clicks</code>
<br/> OK: <code>avgClicks</code>
<br/> BAD: <code><span style="color:red">avg_Clicks</span></code>
</li>
<!-- <li><code>FunctionName </code> -->
<li><code>함수 이름</code>
<br/> GOOD: <code>CalculateAvgClicks</code>
<br/> BAD: <code><span style="color:red">calculate_avg_clicks
</span></code>,
<code><span style="color:red">calculateAvgClicks</span></code>
<!-- <br/> Make function names verbs. -->
<br/> 함수의 이름은 동사로 만듭니다.
<!-- <br/><em style = "font-weight: bold;">Exception: When creating a classed object, the function
name (constructor) and class should match (e.g., lm).</em></li> -->
<br/><em style = "font-weight: bold;">예외: 클래스된 대상(classed object)을 생성할 때에는,
함수 이름(constructor)과 클래스를 맞춰야 합니다.(보기, lm).</em></li>
<li><code>kConstantName </code></li>
</ul>
<h3>Syntax</h3>
<h4 id="linelength">줄길이(Line Length)</h4>
<p>
<!-- The maximum line length is 80 characters. -->
줄 길이는 최대 80 글자입니다.
</p>
<h4 id="indentation">들여 쓰기(Indentation)</h4>
<p>
<!-- When indenting your code, use two spaces. Never use tabs or mix tabs and spaces. -->
코드를 들여 쓰기 할 때, 공백 두 개(two spaces)을 사용하십시오.
절대로 탭이나 탭과 공백을 섞어서 사용하지 마세요.
<!-- <br/><em style = "font-weight: bold;">Exception: When a line break occurs inside parentheses,
align the wrapped line with the first character inside the
parenthesis.</em> -->
<br/><em style = "font-weight: bold;">예외: 괄호 안에서 줄을 바꿀 때,
줄 바꿈된 행(line)을 괄호 안의 첫 번째 문자와 맞춥니다.</em>
</p>
<h4 id="spacing">공백 넣기(Spacing)</h4>
<p>
<!-- Place spaces around all binary operators (<code>=</code>,
<code>+</code>, <code>-</code>, <code>&lt;-</code>, etc.).
<br/><em style = "font-weight: bold;"> Exception: Spaces around <code>=</code>'s are
optional when passing parameters in a function call.</em> -->
모든 이진 연산자 (<code>=</code>,
<code>+</code>, <code>-</code>, <code>&lt;-</code>, 등)
앞뒤에 공백을 넣으십시오.
<br/><em style = "font-weight: bold;"> 예외 :
함수 호출에서 매개 변수(parameters)를 전달할 때
<code>=</code> 앞뒤에 공백을 넣는 것은 선택 사항입니다.</em>
</p>
<p>
<!-- Do not place a space before a comma, but always place one after a
comma. -->
쉼표 앞에 공백을 두지 말고, 항상 쉼표 뒤에 공백 한 칸을 넣으십시오.
<br/><br/> GOOD:
</p>
<pre>tab.prior &lt;- table(df[df$days.from.opt &lt; 0, "campaign.id"])
total &lt;- sum(x[, 1])
total &lt;- sum(x[1, ])</pre>
<p>
BAD:
</p>
<pre><span style="color:red">tab.prior &lt;- table(df[df$days.from.opt&lt;0, "campaign.id"]) # <!--Needs spaces around '&lt;' -->'&lt;'주위에 공백이 필요합니다.
tab.prior &lt;- table(df[df$days.from.opt &lt; 0,"campaign.id"]) # <!-- Needs a space after the comma -->쉼표 뒤에 공백 한 칸를 넣으세요
tab.prior&lt;- table(df[df$days.from.opt &lt; 0, "campaign.id"]) # <!-- Needs a space before &lt;- --> &lt;- 앞에 공백 한 칸를 넣으세요
tab.prior&lt;-table(df[df$days.from.opt &lt; 0, "campaign.id"]) # <!-- Needs spaces around &lt;- --> &lt;- 주위에 공백이 필요합니다
total &lt;- sum(x[,1]) # <!-- Needs a space after the comma --> 쉼표 뒤에 공백 한 칸를 넣으세요
total &lt;- sum(x[ ,1]) # <!-- Needs a space after the comma, not before --> 쉼표 앞이 아니라 뒤에 공백 한 칸를 넣으세요</span>
</pre>
<p>
<!-- Place a space before left parenthesis, except in a function call. -->
함수 호출을 제외하고, 왼쪽 괄호 앞에 공백을 둡니다.
</p>
<p>
GOOD:
<br/><code>if (debug)</code>
</p>
<p>
BAD:
<br/><code><span style="color:red">if(debug)</span></code>
</p>
<p>
<!-- Extra spacing (i.e., more than one space in a row) is okay if it
improves alignment of equals signs or arrows (<code>&lt;-</code>). -->
같다(번역자 추가: =)나 화살표 (<code>&lt;-</code>) 기호의 정렬을
향상시키는 것이라면 여분의 공백(즉, 한 줄에 두 개 이상의 공백)을
넣어도 괜찮습니다.
</p>
<pre>plot(x = x.coord,
y = data.mat[, MakeColName(metric, ptiles[1], "roiOpt")],
ylim = ylim,
xlab = "dates",
ylab = metric,
main = (paste(metric, " for 3 samples ", sep = "")))
</pre>
<p>
<!-- Do not place spaces around code in parentheses or square brackets. -->
괄호 나 대괄호 안에 코드 주위에는 공백을 넣지 마십시오.
<!-- <br/><em style = "font-weight: bold;"> Exception: Always place a space after a comma.</em> -->
<br/><em style = "font-weight: bold;"> 예외 : 항상 쉼표 뒤에 공백을 넣으십시오.</em>
</p>
<p>
GOOD:</p><pre>if (debug)
x[1, ]</pre>
<p>
BAD:</p><pre><span style="color:red">if ( debug ) # No spaces around debug
x[1,] # Needs a space after the comma </span></pre>
<h4 id="curlybraces">중괄호(Curly Braces)</h4>
<p>
<!-- An opening curly brace should never go on its own line; a closing
curly brace should always go on its own line. -->
여는 중괄호는 절대로 그 자체의 줄을 따라 가면 안됩니다;
닫는 중괄호는 항상 자신의 줄에 있어야 합니다.
<!-- You may omit curly
braces when a block consists of a single statement; however, you
must <em style = "font-weight: bold;">consistently</em> either use or not use curly braces for
single statement blocks. -->
블록이 단일 명령문으로 구성되어 있으면
중괄호를 생략할 수 있습니다;
그러나 단일 명령문 블록에 항상 중괄호를
사용하거나 사용하지 않아야 합니다.
</p>
<pre>
if (is.null(ylim)) {
ylim &lt;- c(0, 0.06)
}</pre>
<p>
xor (but not both)
</p>
<pre>
if (is.null(ylim))
ylim &lt;- c(0, 0.06)</pre>
<p>
<!-- Always begin the body of a block on a new line. -->
항상 블록의 몸통은 새로운 줄에서 시작하세요.
</p>
<p>
BAD:
<br/><code><span style="color:red"> if (is.null(ylim))
ylim &lt;- c(0, 0.06)</span></code>
<br/><code><span style="color:red"> if (is.null(ylim))
{ylim &lt;- c(0, 0.06)} </span></code>
</p>
<h4 id="else">else를 괄호로 둘러싸기(Surround else with braces)</h4>
<p>
<!-- An <code>else</code> statement should always be surrounded on the
same line by curly braces. -->
<code>else</code> 명령문은 중괄호로 항상 같은 줄에서 둘러싸여야 합니다.</p>
<pre>
if (condition) {
one or more lines
} else {
one or more lines
}
</pre>
<p>
BAD:<br/>
</p>
<pre style="color:red">
if (condition) {
one or more lines
}
else {
one or more lines
}
</pre>
<p>
BAD:<br/>
</p>
<pre style="color:red">
if (condition)
one line
else
one line
</pre>
<h4 id="assignment">할당(Assignment)</h4>
<p>
<!-- Use <code>&lt;-</code>, not <code>=</code>, for assignment. -->
할당하기 위해서 <code>&lt;-</code>을 사용하고,
<code>=</code>을 사용하지 마세요.
</p>
<p>
GOOD:
<br/><code> x &lt;- 5 </code>
</p>
<p>
BAD:
<br/><code><span style="color:red"> x = 5</span></code>
</p>
<h4 id="semicolons">세미콜론(Semicolons)</h4>
<p>
<!-- Do not terminate your lines with semicolons or use semicolons to
put more than one command on the same line. (Semicolons are not
necessary, and are omitted for consistency with other Google style
guides.) -->
세미콜론을 가지고 여러분의 줄을 제거하지 말고
세미콜론을 사용하여 같은 줄에 한 개 이상의 명령를 넣지 마세요.
(세미콜론이 꼭 필요하지도 않고,
다른 구글 스타일 가이드에서도 지속적으로 생략하고 있습니다.)
</p>
<h3> Organization </h3>
<h4 id="generallayout">일반적인 레이아웃과 순서(General Layout and Ordering)</h4>
<p>
<!-- If everyone uses the same general ordering, we'll be able to
read and understand each other's scripts faster and more easily. --> 만약 모든 사람들이 똑같은 일반적인 순서를 사용한다면,
우리는 다른 사람들의 스크립터(scripts)를
더 빠르고 더 쉽게 이해하고 읽을 수 있을 것입니다.
</p>
<ol>
<li>Copyright statement comment </li>
<li>Author comment</li>
<li>File description comment, including purpose of
program, inputs, and outputs</li>
<li><code>source()</code> and <code>library()</code> statements</li>
<li>Function definitions</li>
<li>Executed statements, if applicable (e.g.,
<code> print</code>, <code>plot</code>)</li>
</ol>
<p>
Unit tests should go in a separate file named
<code>originalfilename_test.R</code>.
</p>
<h4 id="comments">주석 달기 지침(Commenting Guidelines)</h4>
<p>
<!-- Comment your code. Entire commented lines should begin with
<code>#</code> and one space. -->
여러분 코드에 주석을 다세요.
모든 주석이 있는 줄은 <code>#</code>과 공백 한 칸(one space)으로
시작해야 합니다.
</p>
<p>
<!-- Short comments can be placed after code preceded by two spaces,
<code>#</code>, and then one space. -->
코드 뒤에 오는 짧은 주석은 공백 2칸(two spaces)을 한 다음, <code>#</code>, 그런 다음 공백 한 칸(one space) 뒤에 위치합니다.
</p>
<pre># Create histogram of frequency of campaigns by pct budget spent.
hist(df$pct.spent,
breaks = "scott", # method for choosing number of buckets
main = "Histogram: fraction budget spent by campaignid",
xlab = "Fraction of budget spent",
ylab = "Frequency (count of campaignids)")
</pre>
<h4 id="functiondefinition">함수 정의와 호출(Function Definitions and
Calls)</h4>
<p>
<!-- Function definitions should first list arguments without default
values, followed by those with default values. -->
함수 정의는 우선 디폴트 값이 없는 인수(arguments)부터
우선 배열하고 디폴트 값이 있는 것들이 뒷따라 와야 합니다.
</p>
<p>
<!-- In both function definitions and function calls, multiple
arguments per line are allowed; line breaks are only allowed
between assignments. --> 함수 정의와 함수 호출 모두,
한 줄에 여러 개의 인수(arguments)가 허용됩니다;
줄 바꿈은 오로지 할당 사이에서만 허용됩니다.
<br/>GOOD:
</p>
<pre>PredictCTR &lt;- function(query, property, num.days,
show.plot = TRUE)
</pre>
BAD:
<pre><span style="color:red">PredictCTR &lt;- function(query, property, num.days, show.plot =
TRUE)
</span></pre>
<p> Ideally, unit tests should serve as sample function calls (for
shared library routines). 이상적으로, 단위 테스트는
샘플 함수 호출로 사용되어야 합니다(공유된 라이브러러 루틴을 위해서)
</p>
<h4 id="functiondocumentation">함수 문서화(Function Documentation)</h4>
<p> <!-- Functions should contain a comments section immediately below
the function definition line. -->
함수는 함수를 정의한 줄 바로 아래의 주석 섹션을 가져와야 합니다.
<!-- These comments should consist of a
one-sentence description of the function; -->
이런 주석은 그 함수를 한 문장으로 기술하는 것으로 구성되어야 합니다.
<!-- a list of the function's
arguments, denoted by <code>Args:</code>, with a description of
each (including the data type); and a description of the return
value, denoted by <code>Returns:</code>. -->
그 함수의 인수들(arguments)의 목록은 <code>Args:</code>로 표시하고,
각각의 설명(description)을 가집니다; 그리고 반환(return) 값 설명은,
<code>Args:</code>로 표시합니다.
<!-- The comments should be
descriptive enough that a caller can use the function without
reading any of the function's code. -->
주석은 호출자(caller)가 그 함수의 어떤 코드도 읽지 않고
사용할 수 있을만큼 충분한 설명이어야 합니다.
</p>
<h4 id="examplefunction">Example Function</h4>
<pre>
CalculateSampleCovariance &lt;- function(x, y, verbose = TRUE) {
# Computes the sample covariance between two vectors.
#
# Args:
# x: One of two vectors whose sample covariance is to be calculated.
# y: The other vector. x and y must have the same length, greater than one,
# with no missing values.
# verbose: If TRUE, prints sample covariance; if not, not. Default is TRUE.
#
# Returns:
# The sample covariance between x and y.
n &lt;- length(x)
# Error handling
if (n &lt;= 1 || n != length(y)) {
stop("Arguments x and y have different lengths: ",
length(x), " and ", length(y), ".")
}
if (TRUE %in% is.na(x) || TRUE %in% is.na(y)) {
stop(" Arguments x and y must not have missing values.")
}
covariance &lt;- var(x, y)
if (verbose)
cat("Covariance = ", round(covariance, 4), ".\n", sep = "")
return(covariance)
}
</pre>
<h4 id="todo">TODO Style</h4>
<p>
<!-- Use a consistent style for TODOs throughout your code. -->
코드 전체에서 TODO를 위하여 일관된 스타일을 사용하십시오.
<br/><code>TODO(username): Explicit description of action to
be taken</code>
</p>
<h3> Language </h3>
<h4 id="attach">Attach</h4>
<p> <!-- The possibilities for creating errors when using
<code>attach</code> are numerous. Avoid it. -->
<code>attach</code>를 사용할 때 에러(errors)를 생성하게 될 가능성이
많습니다. 조심하세요.</p>
<h4 id="functionlanguage">Functions</h4>
<p> <!-- Errors should be raised using <code>stop()</code>. -->
<code>stop()</code>을 사용할 때에는 에러가 발생하게 해야 합니다.</p>
<h4 id="object">Objects and Methods</h4>
<p> <!-- The S language has two object systems, S3 and S4, both of which
are available in R. S3 methods are more interactive and flexible,
whereas S4 methods are more formal and rigorous. (For an illustration
of the two systems, see Thomas Lumley's
"Programmer's Niche: A Simple
Class, in S3 and S4" in R News 4/1, 2004, pgs. 33 - 36: -->
S 언어는 2개의 객체 시스템, S3와 S4를 가지고 있고 있으며,
이 둘 모두 R에서는 사용가능합니다.
S3 메소드(methods)는 더 상호 작용적이고(interactive) 더 유연하며,
반면에 S4 메소드(methods)는 보다 형식적이고 엄격합니다.
(두 시스템에 대한 설명을 위해서, Thomas Lumley's
"Programmer's Niche: A Simple
Class, in S3 and S4" in R News 4/1, 2004, pgs. 33 - 36 을 보세요: )
<a href="https://cran.r-project.org/doc/Rnews/Rnews_2004-1.pdf">
https://cran.r-project.org/doc/Rnews/Rnews_2004-1.pdf</a>.)
</p>
<p><!-- Use S3 objects and methods unless there is a strong reason to use
S4 objects or methods. -->
S4 객체 또는 메소드를 사용할 강력한 이유가 없는 한
S3 객체 및 메소드를 사용하십시오.
<!-- A primary justification for an S4 object
would be to use objects directly in C++ code. -->
S4 객체를 위한 근본적인 정당성(justification)는
C ++ 코드에서 객체를 직접 사용하는 것입니다. <!-- A primary
justification for an S4 generic/method would be to dispatch on two
arguments. -->
S4 제네틱/메소드(generic / method)을 위한 근본적인 정당성은
두 개의 인수를 전달하는 것입니다.
</p>
<p><!-- Avoid mixing S3 and S4: S4 methods ignore S3 inheritance and
vice-versa. -->
S3과 S4을 섞는 것을 피하십시오.
S4 메소드(methods)는 S3 상속을 무시하고
그 반대의 경우도 마찬가지입니다.
</p>
<h3>Exceptions</h3>
<p>
<!-- The coding conventions described above should be followed, unless
there is good reason to do otherwise. -->
다르게 할 좋은 이유가 없는 한, 위에서
설명한 코딩 관습(conventions)을 따라야 합니다.
<!-- Exceptions include legacy
code and modifying third-party code. -->
예외로는 레거시(legacy) 코드 및 제 3 자 코드(third-party) 수정이 포함됩니다.
</p>
<h3>Parting Words</h3>
<p>
<!-- Use common sense and BE CONSISTENT. -->
상식을 사용하고 일관성을 유지하십시오.
</p>
<p>
<!--If you are editing code, take a few minutes to look at the code around
you and determine its style.-->
여러분들이 코드를 편집하는 경우,
몇 분 정도 시간을 내어 주변의 코드를 쳐다 보고 스타일을 결정하십시오.
<!-- If others use spaces around their
<code>if </code>
clauses, you should, too. -->
만약 다른 사람들이 <code>if </code> 문 앞뒤에 공백을 사용한다면,
역시 여러분들도 그렇게 해야 합니다.
<!-- If their comments have little boxes of stars
around them, make your comments have little boxes of stars around them,
too. -->
만약 그들의 주석 둘레를 별표로 만든 작은 상자로 둘러싸여 있다면,
여러분의 주석도 별표로 만든 작은 상자로 둘러지도록 만들어야 합니다.
</p>
<p>
<!-- The point of having style guidelines is to have a common vocabulary of
coding so people can concentrate on <em style = "font-weight: bold;">what</em> you are saying,
rather than on <em style = "font-weight: bold;">how</em> you are saying it. -->
스타일 가이드 라인을 갖추고 있다는 점은 코딩하는데
공통 어휘를 갖는다는 것이기에
사람들은 여러분들이 말하고자 하는 <em style = "font-weight: bold;">방식</em>보다는
말하고 있는 <em style = "font-weight: bold;">것</em>에 집중할 수 있게 됩니다.
<!-- We present global style
rules here so people
know the vocabulary. -->
우리는 사람들이 그 어휘를 알 수 있도록
여기에 전반적인(global) 스타일 규칙을 제시합니다.
<!-- But local style is also important. -->
그러나 특정한(local) 스타일 역시 중요합니다.
<!-- If code you add
to a file looks drastically different from the existing code around it,
the discontinuity will throw readers out of their rhythm when they go to
read it. -->
만약 여러분이 파일에 추가하는 코드가 기존 코드와 크게 다르다면,
그런 불연속은 (코드를) 보는 사람들의
리듬을 어긋나게 합니다.
<!-- Try to avoid this. -->
이러한 일이 없도록 신경써주세요.
</p>
<p>
<!-- OK, enough writing about writing code; the code itself is much more
interesting. Have fun! -->
OK, 코드를 쓰는 법에 대해선 이 정도로 충분합니다;
코드 자체가 더 흥미로운 법이지요. 수고하세요!
</p>
<h3>References</h3>
<p>
<a href="http://www.maths.lth.se/help/R/RCC/">
http://www.maths.lth.se/help/R/RCC/</a> - R Coding Conventions
</p>
<p>
<a href="http://ess.r-project.org/">http://ess.r-project.org/</a> - For
emacs users. This runs R in your emacs and has an emacs mode.
</p>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment