Skip to contents

You can subset studies by identifier or by position using the `[` operator.

Usage

# S4 method for studies,missing,missing,missing
[(x, i, j, ..., drop = FALSE)

# S4 method for studies,numeric,missing,missing
[(x, i, j, ..., drop = FALSE)

# S4 method for studies,character,missing,missing
[(x, i, j, ..., drop = FALSE)

Arguments

x

A studies object.

i

Position of the identifier or the name of the identifier itself.

j

Not used.

...

Additional arguments not used here.

drop

Not used.

Value

A studies object.

Examples

# Subset a studies object by identifier
studies_ex01['GCST001585']
#> An object of class "studies"
#> Slot "studies":
#> # A tibble: 1 × 13
#>   study_id reported_trait initial_sample_size replication_sample_s…¹ gxe   gxg  
#>   <chr>    <chr>          <chr>               <chr>                  <lgl> <lgl>
#> 1 GCST001… Breast size    16,175 European an… NA                     FALSE FALSE
#> # ℹ abbreviated name: ¹​replication_sample_size
#> # ℹ 7 more variables: snp_count <int>, qualifier <chr>, imputed <lgl>,
#> #   pooled <lgl>, study_design_comment <chr>, full_pvalue_set <lgl>,
#> #   user_requested <lgl>
#> 
#> Slot "genotyping_techs":
#> # A tibble: 1 × 2
#>   study_id   genotyping_technology       
#>   <chr>      <chr>                       
#> 1 GCST001585 Genome-wide genotyping array
#> 
#> Slot "platforms":
#> # A tibble: 1 × 2
#>   study_id   manufacturer
#>   <chr>      <chr>       
#> 1 GCST001585 Illumina    
#> 
#> Slot "ancestries":
#> # A tibble: 1 × 4
#>   study_id   ancestry_id type    number_of_individuals
#>   <chr>            <int> <chr>                   <int>
#> 1 GCST001585           1 initial                 16175
#> 
#> Slot "ancestral_groups":
#> # A tibble: 1 × 3
#>   study_id   ancestry_id ancestral_group
#>   <chr>            <int> <chr>          
#> 1 GCST001585           1 European       
#> 
#> Slot "countries_of_origin":
#> # A tibble: 1 × 5
#>   study_id   ancestry_id country_name major_area region
#>   <chr>            <int> <chr>        <chr>      <chr> 
#> 1 GCST001585           1 NA           NA         NA    
#> 
#> Slot "countries_of_recruitment":
#> # A tibble: 1 × 5
#>   study_id   ancestry_id country_name major_area region
#>   <chr>            <int> <chr>        <chr>      <chr> 
#> 1 GCST001585           1 NA           NA         NA    
#> 
#> Slot "publications":
#> # A tibble: 1 × 7
#>   study_id   pubmed_id publication_date publication   title      author_fullname
#>   <chr>          <int> <date>           <chr>         <chr>      <chr>          
#> 1 GCST001585  22747683 2012-06-29       BMC Med Genet Genetic v… Eriksson N     
#> # ℹ 1 more variable: author_orcid <chr>
#> 

# Or by its position in table studies
studies_ex01[1]
#> An object of class "studies"
#> Slot "studies":
#> # A tibble: 1 × 13
#>   study_id reported_trait initial_sample_size replication_sample_s…¹ gxe   gxg  
#>   <chr>    <chr>          <chr>               <chr>                  <lgl> <lgl>
#> 1 GCST001… Breast size    16,175 European an… NA                     FALSE FALSE
#> # ℹ abbreviated name: ¹​replication_sample_size
#> # ℹ 7 more variables: snp_count <int>, qualifier <chr>, imputed <lgl>,
#> #   pooled <lgl>, study_design_comment <chr>, full_pvalue_set <lgl>,
#> #   user_requested <lgl>
#> 
#> Slot "genotyping_techs":
#> # A tibble: 1 × 2
#>   study_id   genotyping_technology       
#>   <chr>      <chr>                       
#> 1 GCST001585 Genome-wide genotyping array
#> 
#> Slot "platforms":
#> # A tibble: 1 × 2
#>   study_id   manufacturer
#>   <chr>      <chr>       
#> 1 GCST001585 Illumina    
#> 
#> Slot "ancestries":
#> # A tibble: 1 × 4
#>   study_id   ancestry_id type    number_of_individuals
#>   <chr>            <int> <chr>                   <int>
#> 1 GCST001585           1 initial                 16175
#> 
#> Slot "ancestral_groups":
#> # A tibble: 1 × 3
#>   study_id   ancestry_id ancestral_group
#>   <chr>            <int> <chr>          
#> 1 GCST001585           1 European       
#> 
#> Slot "countries_of_origin":
#> # A tibble: 1 × 5
#>   study_id   ancestry_id country_name major_area region
#>   <chr>            <int> <chr>        <chr>      <chr> 
#> 1 GCST001585           1 NA           NA         NA    
#> 
#> Slot "countries_of_recruitment":
#> # A tibble: 1 × 5
#>   study_id   ancestry_id country_name major_area region
#>   <chr>            <int> <chr>        <chr>      <chr> 
#> 1 GCST001585           1 NA           NA         NA    
#> 
#> Slot "publications":
#> # A tibble: 1 × 7
#>   study_id   pubmed_id publication_date publication   title      author_fullname
#>   <chr>          <int> <date>           <chr>         <chr>      <chr>          
#> 1 GCST001585  22747683 2012-06-29       BMC Med Genet Genetic v… Eriksson N     
#> # ℹ 1 more variable: author_orcid <chr>
#> 

# Keep all studies except the first
studies_ex01[-1]
#> An object of class "studies"
#> Slot "studies":
#> # A tibble: 1 × 13
#>   study_id reported_trait initial_sample_size replication_sample_s…¹ gxe   gxg  
#>   <chr>    <chr>          <chr>               <chr>                  <lgl> <lgl>
#> 1 GCST003… Breast size    33,790 European an… NA                     FALSE FALSE
#> # ℹ abbreviated name: ¹​replication_sample_size
#> # ℹ 7 more variables: snp_count <int>, qualifier <chr>, imputed <lgl>,
#> #   pooled <lgl>, study_design_comment <chr>, full_pvalue_set <lgl>,
#> #   user_requested <lgl>
#> 
#> Slot "genotyping_techs":
#> # A tibble: 1 × 2
#>   study_id   genotyping_technology       
#>   <chr>      <chr>                       
#> 1 GCST003985 Genome-wide genotyping array
#> 
#> Slot "platforms":
#> # A tibble: 1 × 2
#>   study_id   manufacturer
#>   <chr>      <chr>       
#> 1 GCST003985 Illumina    
#> 
#> Slot "ancestries":
#> # A tibble: 1 × 4
#>   study_id   ancestry_id type    number_of_individuals
#>   <chr>            <int> <chr>                   <int>
#> 1 GCST003985           1 initial                 33790
#> 
#> Slot "ancestral_groups":
#> # A tibble: 1 × 3
#>   study_id   ancestry_id ancestral_group
#>   <chr>            <int> <chr>          
#> 1 GCST003985           1 European       
#> 
#> Slot "countries_of_origin":
#> # A tibble: 1 × 5
#>   study_id   ancestry_id country_name major_area region
#>   <chr>            <int> <chr>        <chr>      <chr> 
#> 1 GCST003985           1 NA           NA         NA    
#> 
#> Slot "countries_of_recruitment":
#> # A tibble: 1 × 5
#>   study_id   ancestry_id country_name major_area region
#>   <chr>            <int> <chr>        <chr>      <chr> 
#> 1 GCST003985           1 NA           NA         NA    
#> 
#> Slot "publications":
#> # A tibble: 1 × 7
#>   study_id   pubmed_id publication_date publication title        author_fullname
#>   <chr>          <int> <date>           <chr>       <chr>        <chr>          
#> 1 GCST003985  27182965 2016-05-15       Nat Genet   Detection a… Pickrell JK    
#> # ℹ 1 more variable: author_orcid <chr>
#>