3

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.

R Code

load the library Rcurl

library(RCurl)

specify the URL for the Iris data CSV

urlfile = 'https://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data'

download the file

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?

1 Answer 1

3

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)
1
  • Sorry, the newlines in my post did not work correctly.
    – Katherine
    Sep 15, 2018 at 2:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.