as_tdmurl: Coerce a url to a tdmurl with a specific type

View source: R/as_tdmurl.R

as_tdmurlR Documentation

Coerce a url to a tdmurl with a specific type

Description

A tmd url is just a URL with some attributes to make it easier to handle within other functions in this package.

Usage

as_tdmurl(url, type, doi = NULL, member = NULL, intended_application = NULL)

## S3 method for class 'tdmurl'
as_tdmurl(url, type, doi = NULL, member = NULL, intended_application = NULL)

## S3 method for class 'character'
as_tdmurl(url, type, doi = NULL, member = NULL, intended_application = NULL)

Arguments

url

(character) A URL.

type

(character) One of 'xml' (default), 'html', 'plain', 'pdf', 'unspecified', or 'all'

doi

(character) A DOI, optional, default: NULL

member

(character) Crossref member id. optional

intended_application

(character) intended application string, optional

Examples

as_tdmurl("http://downloads.hindawi.com/journals/bmri/2014/201717.xml",
   "xml")
as_tdmurl("http://downloads.hindawi.com/journals/bmri/2014/201717.pdf",
   "pdf")
out <-
 as_tdmurl("http://downloads.hindawi.com/journals/bmri/2014/201717.pdf",
   "pdf", "10.1155/2014/201717")
attributes(out)
identical(attr(out, "type"), "pdf")

ropenscilabs/crminer documentation built on May 18, 2022, 7:36 p.m.