Data on the web

# Load the readr package

library(readr)

# Import the csv file: pools

url_csv <- "http://s3.amazonaws.com/assets.datacamp.com/production/course_1478/datasets/swimming_pools.csv"

pools<-read_csv(url_csv)

# Import the txt file: potatoes

url_delim <- "http://s3.amazonaws.com/assets.datacamp.com/production/course_1478/datasets/potatoes.txt"

potatoes<-read_tsv(url_delim)

# Print pools and potatoes

pools

potatoes


# Load the readxl and gdata package

library(readxl)

library(gdata)

# Specification of url: url_xls

url_xls <- "http://s3.amazonaws.com/assets.datacamp.com/production/course_1478/datasets/latitude.xls"

# Import the .xls file with gdata: excel_gdata

excel_gdata<-read.xls(url_xls)

# Download file behind URL, name it local_latitude.xls

download.file(url_xls,destfile="local_latitude.xls")

# Import the local .xls file with readxl: excel_readxl

excel_readxl<-read_excel("local_latitude.xls")


# https URL to the wine RData file.

url_rdata <- "https://s3.amazonaws.com/assets.datacamp.com/production/course_1478/datasets/wine.RData"

# Download the wine file to your working directory

download.file(url_rdata,"wine_local.RData")

# Load the wine data into your workspace using load()

load("wine_local.RData")

# Print out the summary of the wine data

summary(wine)


# Load the httr package

library(httr)

# Get the url, save response to resp

url <- "http://www.example.com/"

resp<-GET(url)

# Print resp

resp

# Get the raw content of resp: raw_content

raw_content<-content(resp,as="raw")

# Print the head of raw_content

head(raw_content)

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • In the simplest setting,fromJSON()can convert character s...
    騰子_Lony閱讀 237評(píng)論 0 0
  • 關(guān)于溝通,我個(gè)人的問題在于——容易緊張。 一直嘗試做到“潤(rùn)物細(xì)無聲”的境界,一直在思考、摸索、練習(xí)中…… 人生真是...
    子元1314閱讀 721評(píng)論 3 2
  • 我叫夏璃沫,2013年8月,猶記得那是個(gè)清爽的月份,我剛轉(zhuǎn)來這個(gè)學(xué)校才半學(xué)期,并不認(rèn)識(shí)很多人,但由于學(xué)習(xí)不錯(cuò),各班...
    匕菏夜閱讀 189評(píng)論 0 0
  • 從上一家公司離職距現(xiàn)在已快一年了,記憶最深刻的莫過于每天的早會(huì)。 不同的部門,不同的人,匯報(bào)工作的方式有的都是大同...
    豆瓣綠兒閱讀 471評(píng)論 5 18

友情鏈接更多精彩內(nèi)容