Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to download in a Colab R notebook a remote dataset from github?

I'm trying to download this dataset from github in a colab R notebook.

I've tried using the magic !git clone https://github.com/guyz/twitter-sentiment-dataset.git but it does not work with an R notebook.

Are there any other possibilities to retrieve the dataset?

like image 541
ciccio.della.vera Avatar asked Dec 06 '25 03:12

ciccio.della.vera


1 Answers

You can run the following R code to download the file in your colab environment (the file is specified with its URL):

install.packages("R.utils")
library("R.utils")
download.file("https://raw.githubusercontent.com/guyz/twitter-sentiment-dataset/master/corpus.csv", 
              "corpus.csv.gz")
gunzip('corpus.csv.gz')

After these instructions you will have the file corpus.csv containing the dataset.

like image 151
Lostefra Avatar answered Dec 08 '25 18:12

Lostefra



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!