Reputation: 31
i have started learning data science and new to R language, i am trying to read data from below HTTPS URL using getURL funtion and Rcurl pacakge.
while executing below code, receiving SSL
protocal issue.
library(RCurl)
urlfile = 'https://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data'
downloaded = getURL(urlfile, ssl.verifypeer=FALSE)
Error
Error in function (type, msg, asError = TRUE) : Unknown SSL protocol error in connection to archive.ics.uci.edu:443
can anyone help me with this answer?
Upvotes: 3
Views: 3551
Reputation: 21
First see if you can read data from the URL with:
fileURL <- "https://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data"
myfile <- readLines(fileURL)
head(myfile)
If you can read data from the URL, then the embedded double quotes in the data may be causing your problem.
Try read.csv with the quote parameter:
iris <- read.csv(fileURL, header = FALSE, sep = ",", quote = "\"'")
names(iris) <- c("sepal_length", "sepal_width", "petal_length", "petal_width", "class")
head(iris)
Upvotes: 2