We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replicate the function of haven, where haven::read_xpt() can pull directly from a URL like GitHub raw files
haven::read_xpt()
URL
Dataframe
datasetjson::read_dataset_json(https://raw.githubusercontent.com/cdisc-org/DataExchange-DatasetJson/master/examples/sdtm/dm.json)
The text was updated successfully, but these errors were encountered:
con <- url( "https://github.com/cdisc-org/DataExchange-DatasetJson/raw/master/examples/sdtm/ti.json", method = "libcurl" ) x <- readLines(con, warn=FALSE) close(con) jsonlite::fromJSON(x)
Sorry, something went wrong.
For a local file for testing:
con <- url(paste0("file://", normalizePath(test_path("testdata", "ta.json"))))
This is url detection from {readr}:
https://github.com/tidyverse/readr/blob/b3d09122074143987754a83ccb6eec730a20a37e/R/source.R#L196
is_url <- function(path) { grepl("^((http|ftp)s?|sftp)://", path) }
Could just add in additionally for local files:
^((http|ftp)s?|sftp|file):\/\/
0b85259
No branches or pull requests
Feature Idea
Replicate the function of haven, where
haven::read_xpt()
can pull directly from a URL like GitHub raw filesRelevant Input
URL
Relevant Output
Dataframe
Reproducible Example/Pseudo Code
The text was updated successfully, but these errors were encountered: