You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was having the same problem as issue #31. It appears that the (now defunct?) RCurl call in your find_file_name function was throwing an ssl error in the dependent find_events function. Replacing with the curl/readlines seems to fix the problem. Below is the code I've substituted for the original. Feel free to use the appended function :
require(curl)
find_file_name2 <- function (year = NULL, file_type = "details")
{
url <- paste0("https://www1.ncdc.noaa.gov/pub/data/swdi/",
"stormevents/csvfiles/")
page<-readLines(curl(url)) #replace RCurl call with curl
all_file_names <- XML::getHTMLLinks(page)
file_year <- paste0("d", year, "")
file_name <- grep(file_type, grep(file_year, all_file_names,
value = TRUE), value = TRUE)
if (length(file_name) == 0) {
stop("No file found for that year and / or file type.")
}
return(file_name)
}
Hi, thanks for developing this package!
I was having the same problem as issue #31. It appears that the (now defunct?) RCurl call in your find_file_name function was throwing an ssl error in the dependent find_events function. Replacing with the curl/readlines seems to fix the problem. Below is the code I've substituted for the original. Feel free to use the appended function :
require(curl)
find_file_name2 <- function (year = NULL, file_type = "details")
{
url <- paste0("https://www1.ncdc.noaa.gov/pub/data/swdi/",
"stormevents/csvfiles/")
page<-readLines(curl(url)) #replace RCurl call with curl
all_file_names <- XML::getHTMLLinks(page)
file_year <- paste0("d", year, "")
file_name <- grep(file_type, grep(file_year, all_file_names,
value = TRUE), value = TRUE)
if (length(file_name) == 0) {
stop("No file found for that year and / or file type.")
}
return(file_name)
}
assignInNamespace("find_file_name", find_file_name2, ns="noaastormevents")
The text was updated successfully, but these errors were encountered: