How to upload a file from GitHub to R?

How to upload a file from GitHub to R?

I uploaded one .csv file to GitHub. Now I want to analyze this data in R. Simply I can download this file and upload to R. But let’s directly upload this file from GitHub to R.

First, we need to know the URL address of this file. If you click your file name in GitHub, you can find the “Raw” button. So, let’s click this button.

Then, in the address bar of your web browser, you can obtain the URL address of your data. The address is https://raw.githubusercontent.com/agronomy4future/raw_data_practice/main/grains.csv

Now, I’ll upload this data from Github to R.

install.packages ("readr")
library(readr)

github <- read_csv("https://raw.githubusercontent.com/agronomy4future/raw_data_practice/main/grains.csv")

Now, the file is uploaded to R.


Leave a Reply

If you include a website address in the comment section, I cannot see your comment as it will be automatically deleted and will not be posted. Please refrain from including website addresses.