Introducing R and RStudio IDE
-Last updated on 2024-02-27 | +
Last updated on 2024-03-05 | Edit this page
@@ -346,13 +346,12 @@Objectives
In this lesson we will take you through the very first things you need to get R working.
-Tip: This lesson works best on the cloud -
+Tip: This lesson works best on the cloud
Remember, these lessons assume we are using the pre-configured virtual machine instances provided to you at a genomics workshop. Much @@ -430,14 +429,13 @@
Discussion: Your experience
http://ec2.12.2.45.678.compute-1.amazonaws.com:8787
-
+
-
-Tip: Make sure there are no spaces before or
-after your URL.
-
+
+Tip: Make sure there are no spaces before or
+after your URL.
If your URL has spaces, your web browser may interpret it as a search
query.
@@ -471,14 +469,13 @@ Tip: Make sure there are no spaces before or
see an RStudio project file, dc_genomics_r.Rproj. All
RStudio projects end with the “.Rproj” file
extension.
-
+
-
-Tip: Make your project more reproducible with
-renv
-
+
+Tip: Make your project more reproducible with
+renv
One of the most wonderful and also frustrating aspects of working
with R is managing packages. We will talk more about them, but packages
@@ -543,13 +540,12 @@
Tip: Make your project more reproducible with
installed packages. “Help” will display help files for R functions and
packages. “Viewer” will allow you to view local web content (e.g. HTML
outputs).
-
+
-
-Tip: Uploads and downloads in the cloud
-
+
+Tip: Uploads and downloads in the cloud
In the “Files” tab you can select a file and download it from your
cloud instance (click the “more” button) to your local computer. Uploads
@@ -563,13 +559,12 @@
Tip: Uploads and downloads in the cloud
+
-
-You are working with R
-
+
+You are working with R
Although we won’t be working with R at the terminal, there are lots
of reasons to. For example, once you have written an RScript, you can
@@ -636,7 +631,7 @@
Exercise: Work interactively in R
Show me the solution
-
+
You will get the same output you did as when you ran
getwd()
from the source. You can run any command in the
@@ -678,13 +673,13 @@
R
-
+
-
-Tip: Never usesetwd()
-
+
+Tip: Never use setwd()
+
Wait, what was the last 2 minutes about? Well, setting your working
directory is something you need to do, you need to be very careful about
@@ -730,7 +725,7 @@
Exercise: What do these functions do?
Show me the solution
-
+
-
dir()
# Lists files in the working directory
@@ -875,7 +870,7 @@ Exercise: Searching for R functions
Show me the solution
-
http://ec2.12.2.45.678.compute-1.amazonaws.com:8787
Tip: Make sure there are no spaces before or -after your URL. -
+Tip: Make sure there are no spaces before or +after your URL.
If your URL has spaces, your web browser may interpret it as a search query.
@@ -471,14 +469,13 @@Tip: Make sure there are no spaces before or
see an RStudio project file, dc_genomics_r.Rproj. All
RStudio projects end with the “.Rproj” file
extension.
-
+
-
-Tip: Make your project more reproducible with
-renv
-
+
+Tip: Make your project more reproducible with
+renv
One of the most wonderful and also frustrating aspects of working
with R is managing packages. We will talk more about them, but packages
@@ -543,13 +540,12 @@
Tip: Make your project more reproducible with
installed packages. “Help” will display help files for R functions and
packages. “Viewer” will allow you to view local web content (e.g. HTML
outputs).
-
+
-
-Tip: Uploads and downloads in the cloud
-
+
+Tip: Uploads and downloads in the cloud
In the “Files” tab you can select a file and download it from your
cloud instance (click the “more” button) to your local computer. Uploads
@@ -563,13 +559,12 @@
Tip: Uploads and downloads in the cloud
+
-
-You are working with R
-
+
+You are working with R
Although we won’t be working with R at the terminal, there are lots
of reasons to. For example, once you have written an RScript, you can
@@ -636,7 +631,7 @@
Exercise: Work interactively in R
Show me the solution
-
+
You will get the same output you did as when you ran
getwd()
from the source. You can run any command in the
@@ -678,13 +673,13 @@
R
-
+
-
-Tip: Never usesetwd()
-
+
+Tip: Never use setwd()
+
Wait, what was the last 2 minutes about? Well, setting your working
directory is something you need to do, you need to be very careful about
@@ -730,7 +725,7 @@
Exercise: What do these functions do?
Show me the solution
-
+
-
dir()
# Lists files in the working directory
@@ -875,7 +870,7 @@ Exercise: Searching for R functions
Show me the solution
-
Tip: Make your project more reproducible with -renv -
+Tip: Make your project more reproducible with +renv
One of the most wonderful and also frustrating aspects of working with R is managing packages. We will talk more about them, but packages @@ -543,13 +540,12 @@
Tip: Make your project more reproducible with
installed packages. “Help” will display help files for R functions and
packages. “Viewer” will allow you to view local web content (e.g. HTML
outputs).
-
+
-
-Tip: Uploads and downloads in the cloud
-
+
+Tip: Uploads and downloads in the cloud
In the “Files” tab you can select a file and download it from your
cloud instance (click the “more” button) to your local computer. Uploads
@@ -563,13 +559,12 @@
Tip: Uploads and downloads in the cloud
+
-
-You are working with R
-
+
+You are working with R
Although we won’t be working with R at the terminal, there are lots
of reasons to. For example, once you have written an RScript, you can
@@ -636,7 +631,7 @@
Exercise: Work interactively in R
Show me the solution
-
+
You will get the same output you did as when you ran
getwd()
from the source. You can run any command in the
@@ -678,13 +673,13 @@
R
-
+
-
-Tip: Never usesetwd()
-
+
+Tip: Never use setwd()
+
Wait, what was the last 2 minutes about? Well, setting your working
directory is something you need to do, you need to be very careful about
@@ -730,7 +725,7 @@
Exercise: What do these functions do?
Show me the solution
-
+
-
dir()
# Lists files in the working directory
@@ -875,7 +870,7 @@ Exercise: Searching for R functions
Show me the solution
-
Tip: Uploads and downloads in the cloud -
+Tip: Uploads and downloads in the cloud
In the “Files” tab you can select a file and download it from your cloud instance (click the “more” button) to your local computer. Uploads @@ -563,13 +559,12 @@
Tip: Uploads and downloads in the cloud
+
-
-You are working with R
-
+
+You are working with R
Although we won’t be working with R at the terminal, there are lots
of reasons to. For example, once you have written an RScript, you can
@@ -636,7 +631,7 @@
Exercise: Work interactively in R
Show me the solution
-
+
You will get the same output you did as when you ran
getwd()
from the source. You can run any command in the
@@ -678,13 +673,13 @@
R
-
+
-
-Tip: Never usesetwd()
-
+
+Tip: Never use setwd()
+
Wait, what was the last 2 minutes about? Well, setting your working
directory is something you need to do, you need to be very careful about
@@ -730,7 +725,7 @@
Exercise: What do these functions do?
Show me the solution
-
+
-
dir()
# Lists files in the working directory
@@ -875,7 +870,7 @@ Exercise: Searching for R functions
Show me the solution
-
You are working with R -
+You are working with R
Although we won’t be working with R at the terminal, there are lots of reasons to. For example, once you have written an RScript, you can @@ -636,7 +631,7 @@
Exercise: Work interactively in R
Show me the solution
-
+
You will get the same output you did as when you ran
getwd()
from the source. You can run any command in the
@@ -678,13 +673,13 @@
R
-
+
-
-Tip: Never usesetwd()
-
+
+Tip: Never use setwd()
+
Wait, what was the last 2 minutes about? Well, setting your working
directory is something you need to do, you need to be very careful about
@@ -730,7 +725,7 @@
Exercise: What do these functions do?
Show me the solution
-
+
-
dir()
# Lists files in the working directory
@@ -875,7 +870,7 @@ Exercise: Searching for R functions
Show me the solution
-
You will get the same output you did as when you ran
getwd()
from the source. You can run any command in the
@@ -678,13 +673,13 @@
R
-
+
-
-Tip: Never usesetwd()
-
+
+Tip: Never use setwd()
+
Wait, what was the last 2 minutes about? Well, setting your working
directory is something you need to do, you need to be very careful about
@@ -730,7 +725,7 @@
Exercise: What do these functions do?
Show me the solution
-
+
-
dir()
# Lists files in the working directory
@@ -875,7 +870,7 @@ Exercise: Searching for R functions
Show me the solution
-
Tip: Never usesetwd()
-
+Tip: Never use setwd()
+
Wait, what was the last 2 minutes about? Well, setting your working directory is something you need to do, you need to be very careful about @@ -730,7 +725,7 @@
Exercise: What do these functions do?
Show me the solution
-
+
-
dir()
# Lists files in the working directory
@@ -875,7 +870,7 @@ Exercise: Searching for R functions
Show me the solution
-
-
dir()
# Lists files in the working directory
@@ -875,7 +870,7 @@