| fetchSamples | R Documentation |
This funciton collects the samples from a data.table-class object that
fulfill the requirements of an attribute attr specified with
the fun argument
fetchSamples(samples, attr = NULL, func = NULL, action = "include")
samples |
an object of |
attr |
a string specifying a column in the |
func |
an anonymous function, see Details for more information |
action |
a string (either |
The anonymous function provided in the func argument has to return an integer that indicate the rows that the action should be performed on.
Core expressions which are most useful to implement the anonymous function are:
which with inequality signs: ==,>,<
grep
an object of data.table-class class filtered according to specified requirements
projectConfig = system.file("extdata", "example_peps-master",
"example_amendments1", "project_config.yaml", package="pepr")
p = Project(projectConfig)
s = sampleTable(p)
fetchSamples(s,attr = "sample_name", func=function(x){ which(x=="pig_0h") },action="include")
fetchSamples(s,attr = "sample_name", func=function(x){ which(x=="pig_0h") },action="exclude")
fetchSamples(s,attr = "sample_name", func=function(x){ grep("pig_",x) },action="include")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.