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

Description Usage Arguments Examples

View source: R/as_ftdmurl.R

Description

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

Usage

1
2
3
4
5
6
7
as_ftdmurl(url, type, doi = NULL, member = NULL, intended_application = NULL)

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

## S3 method for class 'character'
as_ftdmurl(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

1
2
3
4
5
6
7
8
9
as_ftdmurl("http://downloads.hindawi.com/journals/bmri/2014/201717.xml",
   "xml")
as_ftdmurl("http://downloads.hindawi.com/journals/bmri/2014/201717.pdf",
   "pdf")
out <-
 as_ftdmurl("http://downloads.hindawi.com/journals/bmri/2014/201717.pdf",
   "pdf", "10.1155/2014/201717")
attributes(out)
identical(attr(out, "type"), "pdf")

fulltext documentation built on June 12, 2021, 9:06 a.m.