How to use Base R In R Language

Here we are using read.csv() methods, which is an inbuilt function in R programming. This function is similar to Python because it read the CSV file and returns the data into dataframe.

Syntax: 

read.csv(URL)

Example: Read a CSV from URL 

R




# importing Data
data <- read.csv('https://www.stats.govt.nz/assets/Uploads\
/Annual-enterprise-survey/Annual-enterprise-survey-2020-\
financial-year-provisional/Download-data/annual-enterprise\
-survey-2020-financial-year-provisional-csv.csv')
 
# display top 5 row
head(data)


 Output:

How to Read a CSV from URL into R?

In this article, we are going to see how to read CSV files from URL using R Programming Language.

Similar Reads

Method 1: Using Base R

Here we are using read.csv() methods, which is an inbuilt function in R programming. This function is similar to Python because it read the CSV file and returns the data into dataframe....

Method 2: Using data.table

...

Contact Us