How to download data from internet directly into R?

r

#1

I was thinking that when we use to download data from a given link or source we used to go to given site to download it and if the data is updating then more often we are not able to know.Therefore I want to know is there a way in R by which I can download directly into R.


#2

@sid100158,

You can directly load data into from the internet using these commands ->

file <-"<“a href=“Link to the file”>Link to the file”
(without the double quotes just before ‘a href’, I used that double quote because it was converting into a hyperlink itself)
raw_data <- read.csv(file, header=T, skip=1)

So for example if your file is at the link "abc.com/file.txt"
use ->

file <-"<"a href="abc.com/file.txt">abc.com/file.txt" (without the double quotes just before ‘a href’)
raw_data <- read.csv(file, header=T, skip=1)

Hope this helps!