Access a URL and read Data with R

后端 未结 5 1308
醉酒成梦
醉酒成梦 2020-11-27 02:54

Is there a way I can specify and get data from a web site URL on to a CSV file for analysis using R?

5条回答
  •  猫巷女王i
    2020-11-27 03:33

    Beside of read.csv(url("...")) you also can use read.table("http://...").

    Example:

    > sample <- read.table("http://www.ats.ucla.edu/stat/examples/ara/angell.txt")
    > sample
                    V1   V2   V3   V4 V5
    1        Rochester 19.0 20.6 15.0  E
    2         Syracuse 17.0 15.6 20.2  E
    ...
    43         Atlanta  4.2 70.6 32.6  S
    > 
    

提交回复
热议问题