Skip to Main Content

Research Guides

R and R Studio

This guide provides general information about R and R Studio for data manipulation, analysis, and visualization.

Ways to View Data in RStudio

Data in RStudio can be viewed in the a data tab or as output in the console. Environment pane has the name of the datasets that we used on the very top left corner.

Screenshot of environment showing existing data frames

 

 

 

 

 

 

 

To view data in RStudio you may click on the name of the data in the environment. This will open a tab for browsing through data.

Screenshot of my data object in R

There are multiple options to view data in RStudio. You can call on RStudio to show it in the output tab. 

Below is the code for viewing an entire dataset in the RStudio output.

Screenshot of alternative ways to see your data

We are simply stating to the name of the dataset to view it in the output. 

We can also specify to see just the first and last six rows of information in the dataset with the code below.

Screenshot of head and tail functions used with my data object

These two lines of code are going to give you the following:

Screenshot of outcomes of head and tail functions

Alternatively, you can also use glimpse() function from tidyverse package to have a quick look at your data.

Screenshot of glimpse function and its output showcasing column names and first few observations in each column