inst/unitTests/getDefaultToolParameters.R

test <- getDefaultToolParameters <- function() {
    params <- RGraph2js:::getDefaultToolParameters()
    for(url in params) {
        if(grepl(pattern="^http", x=url)) {
            mytempfile <- tempfile()
            tryCatch({download.file(
                          url=url,
                          destfile=mytempfile,
                          quiet=TRUE)},
                     error=function(err) {
                         stop(
                             paste0(
                                 "Cannot access URL ",
                                 url,
                                 " Error: ",
                                 err
                             )
                         )
                 })
            emptymsg <- paste0("The URL ",
                               url,
                               " gives no data!")
            checkTrue(file.info(mytempfile)$size != 0,
                      msg=emptymsg)
        }
    }
    
}

Try the RGraph2js package in your browser

Any scripts or data that you put into this service are public.

RGraph2js documentation built on Nov. 8, 2020, 8:17 p.m.