This is the third part of the series. This article is about how you can import data into R. Importing data into R is simple. Example of Importing data are provided below:

1. Importing CSV in R:R can read .CSV (Comma separated files). The best way to read .csv file is as follows:

# Read CSV into R
Data

Here header=TRUE specifies that this data includes a header row and sep=”,” specifies that the data is separated by commas.

2. Importing Excel File One of the best ways to read an Excel file is to export it to comma delimited file. You can use the xlsx package to access Excel files. The first row should contain column names.

# If First row contains variable names then
library(xlsx)
Data

3. Importing txt File into R

# Reading .txt File as dataframe
Data

Related

Tech enthusiast and an optimistic guy with the mindset to achieve the set target. I am an avid learner and passionate learner. After finding my interest in data science, I felt that 'Yes this is the field which I am looking for. I am more passionate to learn data science and R and looking forward to exploring more in these fields along with the python. I love to share information with people.