Return to site

R-studio 5

broken image


  1. Portable recovery program:https://drive.google.com/uc?id=0B2tjmVfeic3mSTFDai1NbV9HWkk&export=downloadInfo.
  2. R-3.5.3 for Windows (32/64 bit) Download R 3.5.3 for Windows (79 megabytes, 32/64 bit) Installation and other instructions. New features in this version. If you want to double-check that the package you have downloaded matches the package distributed by CRAN, you can compare the md5sum of the.exe to the fingerprint on the master server.
  3. Rajesh Krishnasamy Mississauga, Ontario, Canada Senior Consultant at CIBC Having 14 years of experience in BI tools like Cognos BI Suite & MS BI Suite. 226 connections View Rajesh's homepage, profile, activity, articles.

5.2 RStudio

Open source integrated development environment (IDE) for R developed by R Studio.

  • Edit scripts
  • Run scripts
  • Navigate files
  • Organize projects
  • Utilize version control (Git and Subversion)
  • View static and interactive graphics
  • And more…

5.2.1 Create a New Script

Programming note: Tomorrow, Sunday, I'll be hosting another audio edition of Steyn's Song of the Week on Serenade Radio in the UK at 5.30pm British Summer Time (that's 12.30pm North American Eastern/9.30am Pacific). 5.1.1 Benefits of Using R. Reproducibility: Standardized processes (e.g., functions, loops, documentation) When using MS Excel processes are often spread across multiple sheets or calculations are performed haphazardly within a single sheet. In general, this makes it very hard to interpret processes preformed and to reproduce the process.

  1. Click on the new document button:
  1. Click on R Script:

5.2.2 RStudio Overview

Once you have open an existing script or created a new script, following the instructions from the previous section, your RStudio should look similar to the following image. I have added labels to each of the windows.

5.2.2.1 Source Window

R-studio

R-studio 5.1

This window appears when you open an existing R script or create a new R script Create a New Script. You will perform most of your write, edit, save, and execute your code.

5.2.2.2 Console Window

Similar to the Source Window, code can also be executed in the console but it is not as easy to edit or save code written in the console window. Generally, I only write and execute code in the console window if I am just testing new code or want to quickly view data.

5.2.2.3 Environment, History, Connections, Build, and Git

This window pane includes many features. Here we will only focus on the Environment Tab but I will briefly review the other tabs available.

  • History Tab: view the order in which you have executed code.
  • Connections: connect to databases and show your connections to those databases.
  • Build: will only appear if you are building a custom package because it is used to compile the package and add it to your library.
  • Git: will only appear if you connect your [R Project] to Git (see [GitHub] section).
5.2.2.3.1 Environment Tab

R-studio 5.1

Objects created in the Source Window or the Console Window are stored in the global environment. The Environment tab allows you to view the objects stored in the global environment.

You can read more about environments in Hadely Wickham's Advanced R book available for free online (http://adv-r.had.co.nz/Environments.html).

In the Source Window example, I loaded the iris data frame into the global environment. This data frame will appear within Environment tab. We can see that this data frame has 150 obs. (rows) and 5 variables (columns).

If we click on the blue circle next to iris, we will be provided with a glimpse into the data frame. Below we can see the columns that make up the data frame, the type of data they represent, and the first view values in a given column. The first four columns, Sepal.Length, Sepal.Width, Petal.Length, and Petal.Width, are numeric (num) data type. The last column, Species, is a factor data type.

If we click on the view table button.

The data frame will open in a tab within the Source Window. Here we can scroll through and view all of the data within the iris data frame.

If we want to view a subset of data we can apply a global filter by filtering with…

or we can apply column specific filters if we click the filter button.

The global environment can be cleared by using the clear button.

5.0

R-studio 5.1

This window appears when you open an existing R script or create a new R script Create a New Script. You will perform most of your write, edit, save, and execute your code.

5.2.2.2 Console Window

Similar to the Source Window, code can also be executed in the console but it is not as easy to edit or save code written in the console window. Generally, I only write and execute code in the console window if I am just testing new code or want to quickly view data.

5.2.2.3 Environment, History, Connections, Build, and Git

This window pane includes many features. Here we will only focus on the Environment Tab but I will briefly review the other tabs available.

  • History Tab: view the order in which you have executed code.
  • Connections: connect to databases and show your connections to those databases.
  • Build: will only appear if you are building a custom package because it is used to compile the package and add it to your library.
  • Git: will only appear if you connect your [R Project] to Git (see [GitHub] section).
5.2.2.3.1 Environment Tab

R-studio 5.1

Objects created in the Source Window or the Console Window are stored in the global environment. The Environment tab allows you to view the objects stored in the global environment.

You can read more about environments in Hadely Wickham's Advanced R book available for free online (http://adv-r.had.co.nz/Environments.html).

In the Source Window example, I loaded the iris data frame into the global environment. This data frame will appear within Environment tab. We can see that this data frame has 150 obs. (rows) and 5 variables (columns).

If we click on the blue circle next to iris, we will be provided with a glimpse into the data frame. Below we can see the columns that make up the data frame, the type of data they represent, and the first view values in a given column. The first four columns, Sepal.Length, Sepal.Width, Petal.Length, and Petal.Width, are numeric (num) data type. The last column, Species, is a factor data type.

If we click on the view table button.

The data frame will open in a tab within the Source Window. Here we can scroll through and view all of the data within the iris data frame.

If we want to view a subset of data we can apply a global filter by filtering with…

or we can apply column specific filters if we click the filter button.

The global environment can be cleared by using the clear button.

When your global environment has been cleared the Environment Tab will look like this…

5.2.2.5 Files Tab

  • Open R Scripts by clicking.
  • View file structure without leaving RStudio.
    • Helpful for finding files to import or to verify a file exported.
  • More beneficial if working in an R Project.

5.2.2.6 Plots Tab

  • View plots created in script.
  • You can manually export from this tab.
    • Generally recommended that you write script to do this (reproducible).

5.2.2.7 Packages Tab

  • View packages installed on your computer.
  • Button to update installed packages.
  • Button to install new packages.

5.2.2.8 Help Tab

  • General Structure: Description, Usage, Arguments, See Also, and Examples.
  • Important to review to understand how the function works.

5.2.2.9 Viewer Tab

  • Similar to the Plots Tab but allows you to view interactive plots.

5.2.3 Shortcuts

A list of all RStudio shortcuts can be found here: https://support.rstudio.com/hc/en-us/articles/200711853-Keyboard-Shortcuts

You can also press Alt+Shift+K within RStudio to pull up a list of shortcuts.

Below are my favorite shortcuts:

DescriptionWindows…LinuxMac
Run Current Line/SelectionCtrl+EnterCommand+Enter
Insert Code SectionCtrl+Shift+RCommand+Shift+R
Re-indent LinesCtrl+ICommand+I
Reformat SelectionCtrl+Shift+ACommand+Shift+A
Find and ReplaceCtrl+FCommand+F
UndoCtrl+ZCommand+Z
RedoCtrl+Shift+ZCommand+Shift+Z
CutCtrl+XCommand+X
CopyCtrl+CCommand+C
PasteCtrl+VCommand+V
Select AllCtrl+ACommand+A
Insert Pipe OperatorCtrl+Shift+MCommand+Shift+M
Insert Code ChunkCtrl+Alt+ICommand+Option+I
Restart R SessionCtrl+Shift+F10Command+Shift+F10

As always my accentuation is impeccable service and great looking hair and now I must also ensure the safest environment for you. To prepare for my re-opening, I have completed the BARBICIDE COVID -19 CERTIFICATION. Additionally, I will be implementing the following enhancements:

1. Booking only one client in the studio at a time (the only exception being same family members)

2. Adding an extra 15 minutes between each appointment to ensure I can sanitize all common areas between each client.

3. I will be using the cleaning fluid SANIBLEND RTV which is approved for use against COVID-19.

4. As per before, all towels capes etc. will continue to be fresh single use.

5. Every client must wear a face mask as I must, I will meet you at the door and supply you with a new mask when you arrive. Please use the hand sanitizer right at the front entrance. Due to shampooing and colouring applications I will require you to wear the mask I provide so I do not have to concern myself about damaging your property.

6. The doors to Sola will be locked and you may only gain access by me opening the door so please text me at # 905-302- 6465 to let me know when you are at the door at your prescribed appointment time.

7. Following Public Health Guidelines we are not allowed to provide beverages nor have magazines etc. available, however you may bring your own.

8. I would appreciate you arriving at your appointment on time.

9. To help to alleviate some of the extra business costs I will be adding a COVID-19 surcharge of $3.00 which is a per person charge. Obviously as soon as we are able to remove these restrictions I will remove the surcharge.


Thank you for following these guidelines. I look forward to seeing you all in the coming weeks as we work through this new normal together.

Sincerely, Bob





broken image