<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ckew2twYkqNNvQzLXVBWcg.gif"></figure><p>R is the most widely used programming language in data analysis and data mining. When you first get started with R it can get a little but intimidating if you are a newbie, and sometimes even for statistics pros as the syntax can be a little bit new.</p><p>There are several ways you can access R. You can install it to your Mac, PC or Linux machine and run it from the terminal. There are also various clients you can install to assist you with the user experience.</p><p>Datazar, on the other hand, offers a cloud based client for R. Meaning you can use R right in your browser and analyze data, create charts, use packages and share your results.</p><h3>Creating the Project</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QcmO698Cpp_ObF5Geizsmw.png"><figcaption>Project Creation Popup</figcaption></figure><p>Once logged in to Datazar, click on the “New Project” button on top right corner and fill out the popup with your project name. When finished hit “Create Project” and you’re done! You have created your project.</p><h3>Selecting an R Interface</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dDLf7WJS1T3Z5EZbU45K2g.jpeg"></figure><p>Now you have a choice between two R interfaces: the R console and the R notebook. Both are equally useful and it really all comes down to the preferences.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iv1L4hrfaAQvRNxGr60qJw.jpeg"></figure><p>Let’s go with the R console for now. Click on the “R Console” button. This will take you to your freshly created R Console. It resembles a terminal a little bit and has a text input field at the bottom.</p><h3>R Console</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TofSdfA5HIltjq9ySs9aiw.png"></figure><p>And there you have it. This is your portal to R and it’s crazy-awesome functionality. Let’s test it out with a quick hello world message command.</p><pre>> message(&quot;Hello World&quot;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BqFkOSE-zKqf0otueank_g.png"></figure><p>R comes with datasets already included in the core program. So let’s use the famous <strong><em>iris</em></strong> dataset and play around with it. We’ll run two commands as below:</p><pre>> iris<br>> head(iris)</pre><p>The first command will return the entire dataset and the second command will return the first part of the dataset.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c3xQh6OEcaMEwJi_qqJRlQ.png"></figure><p>The R Console has command history support so you can use your keyboard arrows to navigate to your previous commands.</p><p>Now let’s look at graphics. The R console will return the graphics in-line with the text instead of a separate window as in the terminal. Using the console gives you a more natural feel with a little bit extra something.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MiWeCc3Vr2S0UHB17kqsVg.png"></figure><h3>Importing External Datasets</h3><p>Having a very sophisticated interface is useless if you can’t use data you have collected or gathered. Let’s look at how you can use CSVs in your console.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6kD9BHK5vhoYo5bva20uUw.png"></figure><p>Above the console is a button named “File.” It will show you the list of files you have in your project. Click on the checkbox that’s next to the file you want to import to your R console and click “Load Selected Files.” This ensures only the files you want in your session are loaded and keeps your workspace clean.</p><p>Let’s save the dataset to a variable called dataset:</p><pre>> dataset&lt;-read.csv(&quot;Dataset.csv&quot;)</pre><p>Since this dataset is kind of long, let’s take a part of it and save it to another variable called sample:</p><pre>> sample&lt;-dataset[1:100,]</pre><p>And finally plot the sample dataset:</p><pre>> with(sample,plot(exper,wage,col=union))</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pq9qpywE35zisfADBpFtOg.png"></figure><h3>Importing External Functions</h3><p>The method for importing external functions to your R workspace is exactly the same as the method for importing datasets. Once you’ve imported the function you want from your project, use the following function to use it:</p><pre>> source(&quot;customFunction.r&quot;)</pre><p>This R file can be an R script that contains all your custom-reusable functions. Or even functions you copied from somewhere else.</p><h3>Use External Libraries</h3><p>If you want to juice up your R workspace with extra packages, all you have to do it run this function:</p><pre>> library(&quot;someLibrary&quot;)</pre><p>R has an infinite amount of R packages that are contributed by the community on a regular basis. Packages like <strong><em>ggplot2</em></strong> make your R experience come to life.</p><h3>R Notebook</h3><p>Although we used the R console throughout this entire guide, here’s what it would have looked like if it was made with the R notebook interface.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/835/1*QR4gUJKAnxc9We6MuwbGhw.png"></figure><p>R notebooks are very useful when you want to go back and edit code, especially if you’re working in a team and you want a more presentable format. R consoles on the other hand are great for quick, dirty explorations. Dirty because all your error and commands will be shown. Again, it’s all a personal preference.</p><h3>Links</h3><p>Feel free to copy my file and play around with it:</p><p>R Console: <a href="https://www.datazar.com/file/f3cc3548b-7aa5-419c-83af-03139317ccae">https://www.datazar.com/file/f3cc3548b-7aa5-419c-83af-03139317ccae</a></p><p>R Notebook: <a href="https://www.datazar.com/file/f4e42b36f-944a-4f81-b1eb-688fc7ae9bf5">https://www.datazar.com/file/f4e42b36f-944a-4f81-b1eb-688fc7ae9bf5</a></p><h3>Resources</h3><p>Useful resources and documentation when using R:</p><p>CRAN Manuals</p><p><a href="https://cran.r-project.org/manuals.html">CRAN: Manuals</a></p><p>R-Bloggers</p><p><a href="https://www.r-bloggers.com/">R-bloggers</a></p><p>Datazar Blog: R Language</p><p><a href="https://blog.datazar.com/">Datazar Blog</a></p><p>R Tutor: Introductions</p><p><a href="http://www.r-tutor.com/r-introduction">R Introduction | R Tutorial</a></p><img height="1" width="1" src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8501819634d4"><hr><p><a href="https://blog.datazar.com/how-to-start-an-r-project-8501819634d4">How to Start an R Project</a> was originally published in <a href="https://blog.datazar.com/">Datazar Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>