testing-Rd: Testing Rd types These provide methods for testing if an...

Description Usage Arguments Functions Examples

Description

Testing Rd types

These provide methods for testing if an object is valid.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
is_Rd_string(x, tags = NULL, strict = FALSE, reason = TRUE)

are_Rd_strings(x, tags = NULL, strict = FALSE)

is_Rd_tag(x, tags = NULL, strict = FALSE, reason = TRUE)

are_Rd_tags(x, tags = NULL, strict = FALSE)

is_Rd(x, strict = FALSE)

is_valid_Rd_list(x, tags = NULL, strict = FALSE,
  deep = !isTRUE(strict) || !missing(tags))

is_valid_Rd_object(x, tags = NULL, strict = FALSE,
  deep = !isTRUE(strict) || !missing(tags))

Arguments

x

object to test

tags

the type of tag(s) allowed in the Rd_tag attribute.

strict

if the class must be set. A value of NA indicates that the first level need not be classed but all subsequent must be.

reason

should the reason for failure be included. Used in assertthat::assert_that() and related functions.

deep

should contained elements also be checked for validity?

Functions

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
is_Rd_string('nope')
is_Rd_string(structure('Valid but not strict', Rd_tag='TEXT'))
is_Rd_string(structure('Valid but not strict', Rd_tag='TEXT'), strict=TRUE)
is_Rd_string(Rd_text('Valid and strict'), strict=TRUE)
are_Rd_strings(Rd( Rd_alias('example'), '\n'
                 , Rd_name('example'), '\n'
                 ))
is_Rd_tag(Rd('text'))
is_Rd_tag(Rd_alias('alias'))
are_Rd_tags(Rd( Rd_alias('example'), '\n'
              , Rd_name('example'), '\n'
              ))
is_Rd(list())
is_Rd(list(), strict=TRUE)
is_Rd(Rd(), strict=TRUE)
is_valid_Rd_list(Rd_name('name'))
is_valid_Rd_list(Rd('text'))
is_valid_Rd_list(Rd_text('text'))
is_valid_Rd_object(Rd_name('name'))
is_valid_Rd_object(Rd('text'))
is_valid_Rd_object(Rd_text('text'))

Rd documentation built on May 23, 2019, 9:03 a.m.