<p><div><div><div><div data-width="100" data-show-faces="false" data-send="true" data-layout="button_count" data-height="21" data-href="http://www.r-bloggers.com/introduction-to-r-for-data-science-session-3/"></div></div><div><a data-url="http://www.r-bloggers.com/introduction-to-r-for-data-science-session-3/" data-counturl="http://www.r-bloggers.com/introduction-to-r-for-data-science-session-3/" data-count="horizontal" data-text="Introduction to R for Data Science :: Session 3" class="twitter-share-button" data-via="rbloggers" href="https://twitter.com/share"></a></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://www.exactness.net/post/144812605330"> The Exactness of Mind</a></strong>, and kindly contributed to <a rel="nofollow" href="http://www.r-bloggers.com/">R-bloggers)</a> </div>
<p><br></p>
<p>Welcome to Introduction to R for Data Science Session 3! The course is co-organized by <a target="_blank" href="http://www.datascience.rs/">Data Science Serbia</a> and <a target="_blank" href="http://en.startit.rs/">Startit</a>. You will find all course material (R scripts, data sets, SlideShare presentations, readings) on these pages.</p>
<p>Welcome to the third session of Introduction to R for Data Science! Check out the <a target="_blank" href="http://www.exactness.net/post/143651799365/introduction-to-r-for-data-science">Course Overview</a> to acess the learning material presented thus far.</p>
<p><a target="_blank" href="http://www.datascience.rs/kurs-r-za-data-science/">Data Science Serbia Course Pages [in Serbian]</a></p>
<p><a target="_blank" href="http://startit.rs/uvod-u-r-za-data-science/">Startit Course Pages [in Serbian]</a></p>
<h2><strong>Lecturers</strong></h2>
<ul>
<li><a target="_blank" href="https://rs.linkedin.com/in/kovacbranko">dipl. ing Branko Kovač</a>, Data Analyst at <a target="_blank" href="http://cube.rs/">CUBE</a>, Data Science Mentor at <a target="_blank" href="https://www.springboard.com/">Springboard</a>, Data Science Serbia</li>
<li><a target="_blank" href="http://www.exactness.net/">Goran S. Milovanović, Phd</a>, <a target="_blank" href="http://www.diplomacy.edu/">DataScientist@DiploFoundation</a>, Data Science Serbia</li>
</ul>
<h2><strong>Summary of Session 3, 12. may 2016 :: Introduction to R: Lists and Functions in R</strong></h2>
<p><em>Introduction to lists and functions in R.  <span>R is a higher programming language where one uses the list data type a lot. We will introduce this dynamic data type during this session. R is also a functional programming language: everything that happens in R is a call and an execution of some function. Even “operators” in R – as simple as “+” or “-” – are functions. In this session we learn how to write R functions. We then combine functions and lists to learn about a rather handy lapply() function. Then we proceed to demonstrate the usage of her cousin apply() – applied to matrices across their dimensions.</span></em></p>
<ul>
<li><a target="_blank" href="http://www.exactness.net/post/144812605330#slides">Session 3 SlideShare</a></li>
<li><a target="_blank" href="http://www.exactness.net/post/144812605330#script">Session 3 R Script</a></li>
<li><a target="_blank" href="http://www.exactness.net/post/144812605330#readings">Further Readings</a></li>
<li><a target="_blank" href="http://www.exactness.net/post/144812605330#photos">Session Photos</a></li>
</ul>
<h2><strong>Intro to R for Data Science SlideShare :: Session 3</strong></h2>
<p><iframe height="485" width="595" allowfullscreen src="http://www.slideshare.net/slideshow/embed_code/key/hAaZqtnHM1oMvi"> </iframe>
<div> <strong> <a title="Introduction to R for Data Science :: Session 3" target="_blank" href="http://www.slideshare.net/Krule/introduction-to-r-for-data-science-session-3">Introduction to R for Data Science :: Session 3</a> </strong> from <strong><a target="_blank" href="http://www.slideshare.net/Krule">Goran S. Milovanovic</a></strong> </div>
<p><br><br>
<h2><strong>R script :: Session 3</strong></h2>
<div>
<div>
<pre><span>########################################################</span>
<span># Introduction to R for Data Science</span>
<span># SESSION 3 :: 12 May, 2016</span>
<span># Data Science Community Serbia + Startit</span>
<span># :: Goran S. Milovanović and Branko Kovač ::</span>
<span>########################################################</span>
 
<span># clear all</span>
<a target="_blank" href="http://inside-r.org/r-doc/base/rm"><span>rm</span></a><span>(</span><a target="_blank" href="http://inside-r.org/r-doc/base/list"><span>list</span></a>=<a target="_blank" href="http://inside-r.org/r-doc/base/ls"><span>ls</span></a><span>(</span><span>)</span><span>)</span><span>;</span>
 
<span># It's time to speak about lists</span>
num_vct <span>&lt;-</span> <a target="_blank" href="http://inside-r.org/r-doc/base/c"><span>c</span></a><span>(</span><span>2</span><span>:</span><span>5</span><span>)</span> <span># just another num vector</span>
chr_vct <span>&lt;-</span> <a target="_blank" href="http://inside-r.org/r-doc/base/c"><span>c</span></a><span>(</span><span>&quot;data&quot;</span><span>,</span> <span>&quot;science&quot;</span><span>)</span> <span># char vector</span>
data_frame <span>&lt;-</span> <a target="_blank" href="http://inside-r.org/r-doc/base/data.frame"><span>data.frame</span></a><span>(</span>x = <a target="_blank" href="http://inside-r.org/r-doc/base/c"><span>c</span></a><span>(</span><span>&quot;a&quot;</span><span>,</span> <span>&quot;b&quot;</span><span>,</span> <span>&quot;c&quot;</span><span>,</span> <span>&quot;d&quot;</span><span>)</span><span>,</span> y = <a target="_blank" href="http://inside-r.org/r-doc/base/c"><span>c</span></a><span>(</span><span>1</span><span>:</span><span>4</span><span>)</span><span>)</span> <span># simple df</span>
 
lista <span>&lt;-</span> <a target="_blank" href="http://inside-r.org/r-doc/base/list"><span>list</span></a><span>(</span>data_frame<span>,</span> num_vct<span>,</span> chr_vct<span>)</span> <span># and this is a list</span>
lista <span># this is our list</span>
 
<a target="_blank" href="http://inside-r.org/r-doc/utils/str"><span>str</span></a><span>(</span>lista<span>)</span> <span># about a list</span>
<a target="_blank" href="http://inside-r.org/r-doc/base/length"><span>length</span></a><span>(</span>lista<span>)</span>
 
<a target="_blank" href="http://inside-r.org/r-doc/base/as.list"><span>as.list</span></a><span>(</span>chr_vct<span>)</span> <span># another way to create a list</span>
 
<span># Lists manipulation</span>
<a target="_blank" href="http://inside-r.org/r-doc/base/names"><span>names</span></a><span>(</span>lista<span>)</span> <span>&lt;-</span> <a target="_blank" href="http://inside-r.org/r-doc/base/c"><span>c</span></a><span>(</span><span>&quot;data&quot;</span><span>,</span> <span>&quot;numbers&quot;</span><span>,</span> <span>&quot;words&quot;</span><span>)</span>
 
lista<span>[</span><span>3</span><span>]</span> <span># 3rd element?</span>
lista<span>[</span><span>[</span><span>3</span><span>]</span><span>]</span> <span># 3rd element?</span>
 
<a target="_blank" href="http://inside-r.org/r-doc/base/is.list"><span>is.list</span></a><span>(</span>lista<span>[</span><span>3</span><span>]</span><span>)</span> <span># is this a list?</span>
<a target="_blank" href="http://inside-r.org/r-doc/base/is.list"><span>is.list</span></a><span>(</span>lista<span>[</span><span>[</span><span>3</span><span>]</span><span>]</span><span>)</span> <span># and this?</span>
 
<a target="_blank" href="http://inside-r.org/r-doc/base/class"><span>class</span></a><span>(</span>lista<span>[</span><span>[</span><span>3</span><span>]</span><span>]</span><span>)</span> <span># also a list? not be so sure!</span>
 
lista<span>$</span>words <span># we can also extract an element this way</span>
lista<span>[</span><span>[</span><span>&quot;words&quot;</span><span>]</span><span>]</span> <span># or even like this</span>
 
<a target="_blank" href="http://inside-r.org/r-doc/base/length"><span>length</span></a><span>(</span>lista<span>$</span>words<span>)</span> <span># 2 as expected</span>
 
lista<span>[</span><span>[</span><span>&quot;words&quot;</span><span>]</span><span>]</span><span>[</span><span>1</span><span>]</span> <span># digging even deeper</span>
 
lista<span>$</span>new_elem <span>&lt;-</span> <a target="_blank" href="http://inside-r.org/r-doc/base/c"><span>c</span></a><span>(</span><span>TRUE</span><span>,</span> <span>FALSE</span><span>,</span> <span>FALSE</span><span>,</span> <span>TRUE</span><span>)</span> <span># add new element</span>
 
<a target="_blank" href="http://inside-r.org/r-doc/base/length"><span>length</span></a><span>(</span>lista<span>)</span> <span># now list has 4 elements</span>
lista<span>$</span>new_elem <span>&lt;-</span> <span>NULL</span> <span># but we can remove it easily</span>
 
new_vect <span>&lt;-</span> <a target="_blank" href="http://inside-r.org/r-doc/base/unlist"><span>unlist</span></a><span>(</span>lista<span>)</span> <span># creating a vector from list</span>
 
<span># Introduction to Functions in R</span>
<span># (w. less formalism but tips &amp; tricks added)</span>
 
<span># elementary: a defition of a function in R</span>
fun <span>&lt;-</span> <a target="_blank" href="http://inside-r.org/r-doc/base/function"><span>function</span></a><span>(</span>x<span>)</span> x<span>+</span><span>10</span><span>;</span>
fun<span>(</span><span>5</span><span>)</span>
 
<span># taking two arguments</span>
fun2 <span>&lt;-</span> <a target="_blank" href="http://inside-r.org/r-doc/base/function"><span>function</span></a><span>(</span>x<span>,</span>y<span>)</span> x<span>+</span>y<span>;</span>
fun2<span>(</span><span>3</span><span>,</span><span>4</span><span>)</span>
 
<span># using &quot;{&quot; and &quot;}&quot; to enclose multiple R expresions in the function body</span>
fun <span>&lt;-</span> <a target="_blank" href="http://inside-r.org/r-doc/base/function"><span>function</span></a><span>(</span>x<span>,</span>y<span>)</span> <span>{</span>
  a <span>&lt;-</span> <a target="_blank" href="http://inside-r.org/r-doc/base/sum"><span>sum</span></a><span>(</span>x<span>)</span><span>;</span>
  b <span>&lt;-</span> <a target="_blank" href="http://inside-r.org/r-doc/base/sum"><span>sum</span></a><span>(</span>y<span>)</span><span>;</span>
  a<span>-</span>b
<span>}</span>
r <span>&lt;-</span> <a target="_blank" href="http://inside-r.org/r-doc/base/c"><span>c</span></a><span>(</span><span>5</span><span>,</span><span>4</span><span>,</span><span>3</span><span>)</span><span>;</span>
<a target="_blank" href="http://inside-r.org/r-doc/base/q"><span>q</span></a> <span>&lt;-</span> <a target="_blank" href="http://inside-r.org/r-doc/base/c"><span>c</span></a><span>(</span><span>1</span><span>,</span><span>1</span><span>,</span><span>1</span><span>)</span><span>;</span>
fun<span>(</span>r<span>,</span><a target="_blank" href="http://inside-r.org/r-doc/base/q"><span>q</span></a><span>)</span>
fun<span>(</span><a target="_blank" href="http://inside-r.org/r-doc/base/c"><span>c</span></a><span>(</span><span>5</span><span>,</span><span>4</span><span>,</span><span>3</span><span>)</span><span>,</span><a target="_blank" href="http://inside-r.org/r-doc/base/c"><span>c</span></a><span>(</span><span>1</span><span>,</span><span>1</span><span>,</span><span>1</span><span>)</span><span>)</span> <span># NOTE: &quot;{&quot; and &quot;}&quot; are generally used in R to mark the beginning and the end of block</span>
<span># a function is a function:</span>
<a target="_blank" href="http://inside-r.org/r-doc/base/is.function"><span>is.function</span></a><span>(</span>fun<span>)</span><span>;</span>
<a target="_blank" href="http://inside-r.org/r-doc/base/is.function"><span>is.function</span></a><span>(</span><a target="_blank" href="http://inside-r.org/r-doc/base/log"><span>log</span></a><span>)</span><span>;</span> <span># log is built-in</span>
 
<span># printing function to acess their source code;</span>
fun
<a target="_blank" href="http://inside-r.org/r-doc/base/log"><span>log</span></a> <span># try: is.primitive(log); this one is written in C, belongs to the base package - it's &quot;under the hood&quot;</span>
 
<span># Built in functions + functional programming (&quot;Everything is a function...&quot;)</span>
<span>&quot;^&quot;</span><span>(</span><span>2</span><span>,</span><span>2</span><span>)</span>
<span>&quot;^&quot;</span><span>(</span><span>2</span><span>,</span><span>3</span><span>)</span> <span># magic! - how do you do that?</span>
<span>2</span><span>^</span><span>2</span>
<span>2</span><span>^</span><span>3</span>
<span># the difference between &quot;operators&quot; and &quot;functions&quot; in R: none. Everything is a function:</span>
<span>&quot;+&quot;</span><span>(</span><span>2</span><span>,</span><span>2</span><span>)</span> <span># Four?</span>
<span>2</span><span>+</span><span>2</span> <span># yeah, right</span>
<span># Oh but I love this</span>
<span>&quot;-&quot;</span><span>(</span><span>&quot;+&quot;</span><span>(</span><span>3</span><span>,</span><span>5</span><span>)</span><span>,</span><span>2</span><span>)</span><span>;</span>
<span>&quot;&amp;&quot;</span><span>(</span><span>&quot;>&quot;</span><span>(</span><span>2</span><span>,</span><span>2</span><span>)</span><span>,</span>T<span>)</span><span>;</span>
<span>&quot;&amp;&quot;</span><span>(</span><span>&quot;>&quot;</span><span>(</span><span>3</span><span>,</span><span>2</span><span>)</span><span>,</span>T<span>)</span><span>;</span> <span># punishment: write all your lab code for this week in this fashion...</span>
<span># built in functions:</span>
x <span>&lt;-</span> <span>16</span><span>;</span>
<a target="_blank" href="http://inside-r.org/r-doc/base/sqrt"><span>sqrt</span></a><span>(</span>x<span>)</span><span>;</span>
x <span>&lt;-</span> <a target="_blank" href="http://inside-r.org/r-doc/base/c"><span>c</span></a><span>(</span><span>1</span><span>,</span><span>2</span><span>,</span><span>3</span><span>,</span><span>4</span><span>,</span><span>5</span><span>,</span><span>6</span><span>,</span><span>7</span><span>,</span><span>8</span><span>,</span><span>9</span><span>)</span><span>;</span>
<a target="_blank" href="http://inside-r.org/r-doc/base/mean"><span>mean</span></a><span>(</span>x<span>)</span><span>;</span>
<span># whatch for NAs in statistics (!)</span>
x <span>&lt;-</span> <a target="_blank" href="http://inside-r.org/r-doc/base/c"><span>c</span></a><span>(</span><span>1</span><span>,</span><span>2</span><span>,</span><span>3</span><span>,</span><span>4</span><span>,</span><span>5</span><span>,</span><span>6</span><span>,</span><span>7</span><span>,</span><span>8</span><span>,</span><span>NA</span><span>)</span><span>;</span>
<a target="_blank" href="http://inside-r.org/r-doc/base/mean"><span>mean</span></a><span>(</span>x<span>)</span><span>;</span>
<a target="_blank" href="http://inside-r.org/r-doc/base/mean"><span>mean</span></a><span>(</span>x<span>,</span> na.rm = T<span>)</span><span>;</span> <span># right!</span>
<a target="_blank" href="http://inside-r.org/r-doc/stats/median"><span>median</span></a><span>(</span>x<span>)</span><span>;</span>
<a target="_blank" href="http://inside-r.org/r-doc/stats/sd"><span>sd</span></a><span>(</span>x<span>)</span><span>;</span>
<a target="_blank" href="http://inside-r.org/r-doc/base/sum"><span>sum</span></a><span>(</span>x<span>)</span><span>;</span>
<a target="_blank" href="http://inside-r.org/r-doc/base/sum"><span>sum</span></a><span>(</span>x<span>,</span> na.rm = T<span>)</span><span>;</span> <span># a-ha!</span>
 
<span># Lexical scoping in R + nested functions</span>
<span># example taken from: <a target="_blank" href="http://adv-r.had.co.nz/Functions.html">http://adv-r.had.co.nz/Functions.html</a></span>
<span># &quot;Advanced R&quot; by Hadley Wickham</span>
<span># &quot;;&quot;s added by GSM</span>
x <span>&lt;-</span> <span>1</span><span>;</span>
h <span>&lt;-</span> <a target="_blank" href="http://inside-r.org/r-doc/base/function"><span>function</span></a><span>(</span><span>)</span> <span>{</span>
  y <span>&lt;-</span> <span>2</span><span>;</span>
  i <span>&lt;-</span> <a target="_blank" href="http://inside-r.org/r-doc/base/function"><span>function</span></a><span>(</span><span>)</span> <span>{</span>
    z <span>&lt;-</span> <span>3</span>
    <a target="_blank" href="http://inside-r.org/r-doc/base/c"><span>c</span></a><span>(</span>x<span>,</span> y<span>,</span> z<span>)</span>
  <span>}</span>
  i<span>(</span><span>)</span><span>;</span>
<span>}</span>
h<span>(</span><span>)</span><span>;</span>
 
<span># Messing up argument names (never do this in nested functions unless you have to)</span>
<a target="_blank" href="http://inside-r.org/r-doc/base/rm"><span>rm</span></a><span>(</span>x<span>,</span> h<span>)</span><span>;</span>
x <span>&lt;-</span> <span>1</span><span>;</span>
h <span>&lt;-</span> <a target="_blank" href="http://inside-r.org/r-doc/base/function"><span>function</span></a><span>(</span>x<span>)</span> <span>{</span>
  y <span>&lt;-</span> x<span>+</span><span>1</span>
  i <span>&lt;-</span> <a target="_blank" href="http://inside-r.org/r-doc/base/function"><span>function</span></a><span>(</span>x<span>)</span> <span>{</span>
    z <span>&lt;-</span> x<span>+</span><span>2</span><span>;</span>
    z
  <span>}</span>
  z <span>&lt;-</span> i<span>(</span>x<span>)</span><span>;</span>
  <a target="_blank" href="http://inside-r.org/r-doc/base/c"><span>c</span></a><span>(</span>x<span>,</span>y<span>,</span>z<span>)</span>
<span>}</span>
h<span>(</span>x<span>)</span>
 
<span># Two things that come handy: lapply and apply</span>
<span># Step 1: here's a list:</span>
aList <span>&lt;-</span> <a target="_blank" href="http://inside-r.org/r-doc/base/list"><span>list</span></a><span>(</span><a target="_blank" href="http://inside-r.org/r-doc/base/c"><span>c</span></a><span>(</span><span>1</span><span>,</span><span>2</span><span>,</span><span>3</span><span>)</span><span>,</span>
              <a target="_blank" href="http://inside-r.org/r-doc/base/c"><span>c</span></a><span>(</span><span>4</span><span>,</span><span>5</span><span>,</span><span>6</span><span>)</span><span>,</span>
              <a target="_blank" href="http://inside-r.org/r-doc/base/c"><span>c</span></a><span>(</span><span>7</span><span>,</span><span>8</span><span>,</span><span>9</span><span>)</span><span>,</span>
              <a target="_blank" href="http://inside-r.org/r-doc/base/c"><span>c</span></a><span>(</span><span>10</span><span>,</span><span>11</span><span>,</span><span>12</span><span>)</span><span>)</span><span>;</span>
<span># Step 2: I want to apply the following function:</span>
myFun <span>&lt;-</span> <a target="_blank" href="http://inside-r.org/r-doc/base/function"><span>function</span></a><span>(</span>x<span>)</span> <span>{</span>
  x<span>[</span><span>1</span><span>]</span><span>+</span>x<span>[</span><span>2</span><span>]</span><span>-</span>x<span>[</span><span>3</span><span>]</span>
<span>}</span>
<span># to all elements of the aList list, and get the result as a list again. Here it is:</span>
res <span>&lt;-</span> <a target="_blank" href="http://inside-r.org/r-doc/base/lapply"><span>lapply</span></a><span>(</span>aList<span>,</span> <a target="_blank" href="http://inside-r.org/r-doc/base/function"><span>function</span></a><span>(</span>x<span>)</span> <span>{</span>
  x<span>[</span><span>1</span><span>]</span><span>+</span>x<span>[</span><span>2</span><span>]</span><span>-</span>x<span>[</span><span>3</span><span>]</span>
<span>}</span><span>)</span><span>;</span>
<a target="_blank" href="http://inside-r.org/r-doc/base/unlist"><span>unlist</span></a><span>(</span>res<span>)</span> <span># to get a vector</span>
<a target="_blank" href="http://inside-r.org/r-doc/base/rm"><span>rm</span></a><span>(</span>myFun<span>)</span><span>;</span>
 
<span># Now say I've got a matrix</span>
myMat <span>&lt;-</span> <a target="_blank" href="http://inside-r.org/r-doc/base/matrix"><span>matrix</span></a><span>(</span><a target="_blank" href="http://inside-r.org/r-doc/base/c"><span>c</span></a><span>(</span><span>1</span><span>,</span><span>2</span><span>,</span><span>3</span><span>,</span><span>4</span><span>,</span><span>5</span><span>,</span><span>6</span><span>,</span><span>7</span><span>,</span><span>8</span><span>,</span><span>9</span><span>)</span><span>,</span>
                  <a target="_blank" href="http://inside-r.org/r-doc/base/nrow"><span>nrow</span></a>=<span>3</span><span>,</span>
                  <a target="_blank" href="http://inside-r.org/r-doc/base/ncol"><span>ncol</span></a>=<span>3</span><span>)</span><span>;</span>
<span># btw</span>
<a target="_blank" href="http://inside-r.org/r-doc/base/is.function"><span>is.function</span></a><span>(</span><a target="_blank" href="http://inside-r.org/r-doc/base/matrix"><span>matrix</span></a><span>)</span><span>;</span>
<span># reminder</span>
<a target="_blank" href="http://inside-r.org/r-doc/base/class"><span>class</span></a><span>(</span>myMat<span>)</span><span>;</span>
<a target="_blank" href="http://inside-r.org/r-doc/base/typeof"><span>typeof</span></a><span>(</span>myMat<span>)</span><span>;</span>
<span># now, I want the sums of all rows:</span>
rsMyMat <span>&lt;-</span> <a target="_blank" href="http://inside-r.org/r-doc/base/apply"><span>apply</span></a><span>(</span>myMat<span>,</span> <span>1</span><span>,</span> <a target="_blank" href="http://inside-r.org/r-doc/base/function"><span>function</span></a><span>(</span>x<span>)</span> <span>{</span>
  <a target="_blank" href="http://inside-r.org/r-doc/base/sum"><span>sum</span></a><span>(</span>x<span>)</span>
<span>}</span><span>)</span><span>;</span>
rsMyMat<span>;</span>
<a target="_blank" href="http://inside-r.org/r-doc/base/is.list"><span>is.list</span></a><span>(</span>rsMyMat<span>)</span> <span># just beatiful</span>
<span># for columns:</span>
csMyMat <span>&lt;-</span> <a target="_blank" href="http://inside-r.org/r-doc/base/apply"><span>apply</span></a><span>(</span>myMat<span>,</span> <span>2</span><span>,</span> <a target="_blank" href="http://inside-r.org/r-doc/base/function"><span>function</span></a><span>(</span>x<span>)</span> <span>{</span>
  <a target="_blank" href="http://inside-r.org/r-doc/base/sum"><span>sum</span></a><span>(</span>x<span>)</span>
<span>}</span><span>)</span><span>;</span>
<span># with existings functions such as sum(), this will do:</span>
rsMyMat1 <span>&lt;-</span> <a target="_blank" href="http://inside-r.org/r-doc/base/apply"><span>apply</span></a><span>(</span>myMat<span>,</span> <span>1</span><span>,</span> <a target="_blank" href="http://inside-r.org/r-doc/base/sum"><span>sum</span></a><span>)</span><span>;</span>
rsMyMat1
csMyMat1 <span>&lt;-</span> <a target="_blank" href="http://inside-r.org/r-doc/base/apply"><span>apply</span></a><span>(</span>myMat<span>,</span> <span>2</span><span>,</span> <a target="_blank" href="http://inside-r.org/r-doc/base/sum"><span>sum</span></a><span>)</span><span>;</span>
csMyMat1</pre>
</div>
</div>
<p><a title="Created by Pretty R at inside-R.org" target="_blank" href="http://www.inside-r.org/pretty-r">Created by Pretty R at inside-R.org</a></p>
<p><br></p>
<h2><strong>Readings :: Session 4 [19. May, 2016, @Startit.rs, 19h CET]</strong></h2>
<p> Chapters 1 – 10, <a target="_blank" href="http://heather.cs.ucdavis.edu/~matloff/132/NSPpart.pdf"><strong>The Art of R Programming, Norman Matloff</strong></a></p>
<h2><strong>Session 3 Photos</strong></h2>
<p><img alt="20160428_204815" class="wp-image-907" src="http://i0.wp.com/www.datascience.rs/wp-content/uploads/S3_2-300x225.jpg?resize=300%2C180" data-recalc-dims="1"><img alt="image" class="wp-image-922" src="http://i1.wp.com/www.datascience.rs/wp-content/uploads/S3_3-300x225.jpg?resize=300%2C180" data-recalc-dims="1"></p>
<p><div><div><div><div data-width="55" data-show-faces="false" data-send="true" data-layout="box_count" data-height="62" data-href="http://www.r-bloggers.com/introduction-to-r-for-data-science-session-3/"></div></div><div><a data-url="http://www.r-bloggers.com/introduction-to-r-for-data-science-session-3/" data-counturl="http://www.r-bloggers.com/introduction-to-r-for-data-science-session-3/" data-count="vertical" data-text="Introduction to R for Data Science :: Session 3" class="twitter-share-button" data-via="rbloggers" href="https://twitter.com/share"></a></div><div></div></div><div></div></div>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="http://www.exactness.net/post/144812605330"> The Exactness of Mind</a></strong>.</div>
<hr>
<a rel="nofollow" href="http://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="http://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a title="The R Project for Statistical Computing" rel="nofollow" href="http://www.r-project.org/">R</a> news and <a title="R tutorials" rel="nofollow" href="http://www.r-bloggers.com/?s=tutorial">tutorials</a> on topics such as: <a title="Data science" rel="nofollow" href="http://www.r-bloggers.com/?s=data%20science">Data science</a>, <a title="Big Data" rel="nofollow" href="http://www.r-bloggers.com/?s=Big%20Data">Big Data, <a title="R jobs" rel="nofollow" href="http://www.r-users.com/">R jobs</a>, visualization (<a title="ggplot and ggplot2 tutorials" rel="nofollow" href="http://www.r-bloggers.com/?s=ggplot2">ggplot2</a>, <a title="Boxplots using lattice and ggplot2 tutorials" rel="nofollow" href="http://www.r-bloggers.com/?s=boxplot">Boxplots</a>, <a title="Maps and gis" rel="nofollow" href="http://www.r-bloggers.com/?s=map">maps</a>, <a title="Animation in R" rel="nofollow" href="http://www.r-bloggers.com/?s=animation">animation</a>), programming (<a title="RStudio IDE for R" rel="nofollow" href="http://www.r-bloggers.com/?s=RStudio">RStudio</a>, <a title="Sweave and literate programming" rel="nofollow" href="http://www.r-bloggers.com/?s=sweave">Sweave</a>, <a title="LaTeX in R" rel="nofollow" href="http://www.r-bloggers.com/?s=LaTeX">LaTeX</a>, <a title="SQL and databases" rel="nofollow" href="http://www.r-bloggers.com/?s=SQL">SQL</a>, <a title="Eclipse IDE for R" rel="nofollow" href="http://www.r-bloggers.com/?s=eclipse">Eclipse</a>, <a title="git and github, Version Control System" rel="nofollow" href="http://www.r-bloggers.com/?s=git">git</a>, <a title="Large data in R using Hadoop" rel="nofollow" href="http://www.r-bloggers.com/?s=hadoop">hadoop</a>, <a title="Web Scraping of google, facebook, yahoo, twitter and more using R" rel="nofollow" href="http://www.r-bloggers.com/?s=Web+Scraping">Web Scraping</a>) statistics (<a title="Regressions and ANOVA analysis tutorials" rel="nofollow" href="http://www.r-bloggers.com/?s=regression">regression</a>, <a title="principal component analysis tutorial" rel="nofollow" href="http://www.r-bloggers.com/?s=PCA">PCA</a>, <a title="Time series" rel="nofollow" href="http://www.r-bloggers.com/?s=time+series">time series</a>, <a title="finance trading" rel="nofollow" href="http://www.r-bloggers.com/?s=trading">trading</a>) and more...
<img height="1" alt="" width="1" src="http://feeds.feedburner.com/~r/RBloggers/~4/Q-0bVw_4VEk"></a></div>