Description Usage Arguments Value Examples
If the avar object is of the class expectedClass, then the function returns the avar object as is
If avar is NULL, then the function returns NULL
If avar is a character string corresponding to an existing file, then the file is imported using importFUN
Else, the function stops and returns an error
1 |
avar |
Either an object or a path to a file to import with |
importFUN |
Function to import |
expectedClass |
Character vector. expected class of the object avar |
... |
further arguments passed to |
either NULL if avar is NULL or an object of class expectedClass
1 2 3 4 5 6 7 8 9 10 11 | ## Not run:
# With an object in R
TestArg(1:10, expectedClass = "integer") #returns 1:10
TestArg(1:10, expectedClass = "character") #returns an error
#With a path to a file
Path2Blast <- system.file("extdata", "BAC02_Blast18S.res", package = "NanoBAC")
TestArg(Path2Blast, readBlast, "tbl_df") #returns the imported file
TestArg(Path2Blast, readBlast, "integer") #returns an error
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.