filter.HCAExplorer: Filter an HCAExplorer object using fields and values

Description Usage Arguments Value See Also Examples

View source: R/filter-utilities.R

Description

Given some amount of fields and values associated with them, modify the search performed by the HCAExplorer object. This function adds terms to the query that is ultimately performed.

Usage

1
2
## S3 method for class 'HCAExplorer'
filter(.data, ..., .preserve)

Arguments

.data

An HCAExplorer object to query.

...

Any number of fields and values to queried against. The binary operators '==' and ' '&' is allowed. See examples.

.preserve

Unused argument

Value

An HCAExplorer object with the desired query performed.

See Also

[HCAExplorer()]

HCAExplorer for the HCAExplorer class.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
 ## Initiate an HCAExplorer Object
 x <- HCAExplorer()

 ## First we want to perform a search for certain organs.
 ## Display possible fields looking for organs.
 fields(x)
 ## organs can be queried with "organ".
 ## What values can the field "organ" have?
 values(x, "organ")

 ## Construct a query looking for projects that involve blood or brain.
 y <- x %>% filter(organ %in% c('blood', 'brain'))
 y

 ## Now suppose one would also like to find projects that have a certain
 ## disease. What field corresponds to disease?
 fields(y)
 ## The "disease" field looks right.
 ## What possible disease values can be queried upon?
 values(y, "disease")

 ## Add a query for a 'normal' diease state to our search.
 y <- y %>% filter(disease == 'normal')
 y

 ## This entire query can also be performed at once in several ways.
 x %>% filter(organ == c('blood', 'brain') & disease == 'normal')
 x %>% filter(organ == c('blood', 'brain'), disease == 'normal')

HCAExplorer documentation built on Nov. 8, 2020, 5:45 p.m.