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

2

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)
Sign up to request clarification or add additional context in comments.

1 Comment

Sorry, the newlines in my post did not work correctly.

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.