‘rentrez’ Assignment

1. Create a search of a topic, organism, etc.

# load the necessary packages
library(rentrez)
library(tidyverse)
## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.2 ──
## ✔ ggplot2 3.3.6      ✔ purrr   0.3.5 
## ✔ tibble  3.1.8      ✔ dplyr   1.0.10
## ✔ tidyr   1.2.1      ✔ stringr 1.4.1 
## ✔ readr   2.1.3      ✔ forcats 0.5.2 
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
library(ggplot2)
library(glue)

# create an object to hold the search information
cl_search <- entrez_search(db = "pubmed", 
                           term = "cimex lectularius[ORGN] and 2018:2022[PDAT]",
                           retmax = 100)

cl_search
## Entrez search result with 247 hits (object contains 100 IDs and no web_history object)
##  Search term (as translated):  ("bedbugs"[MeSH Terms] OR "bedbugs"[All Fields] OR ...

2. Use the summary or fetch arguement to extract relevant information to your search.

# get the summary information
cl_multi_sum <- entrez_summary(db= "pubmed", id = cl_search$ids)

# extract elements from the summary using the 
extract_from_esummary(cl_multi_sum,
                      c("title","pubtype","pubdate","authors"),
                      simplify = TRUE)
##         36421963                                                                                                         
## title   "Characterizing Repellencies of Methyl Benzoate and Its Analogs against the Common Bed Bug, Cimex le" [truncated]
## pubtype "Journal Article"                                                                                                
## pubdate "2022 Nov 17"                                                                                                    
## authors data.frame,3                                                                                                     
##         36400831                                                                                                         
## title   "Household perception and infestation dynamics of bedbugs among residential communities and its pote" [truncated]
## pubtype "Journal Article"                                                                                                
## pubdate "2022 Nov 18"                                                                                                    
## authors data.frame,3                                                                                                     
##         36397113                                                                                           
## title   "Systemic veterinary drugs for control of the common bed bug, Cimex lectularius, in poultry farms."
## pubtype "Journal Article"                                                                                  
## pubdate "2022 Nov 17"                                                                                      
## authors data.frame,3                                                                                       
##         36396986                                                                                           
## title   "Comparative analysis of detoxification-related gene superfamilies across five hemipteran species."
## pubtype "Journal Article"                                                                                  
## pubdate "2022 Nov 17"                                                                                      
## authors data.frame,3                                                                                       
##         36232802                                                                                                         
## title   "Characterization of New Defensin Antimicrobial Peptides and Their Expression in Bed Bugs in Respons" [truncated]
## pubtype "Journal Article"                                                                                                
## pubdate "2022 Sep 29"                                                                                                    
## authors data.frame,3                                                                                                     
##         36226901                                                          
## title   "Perspective on Biology and Management of Bed Bugs: Introduction."
## pubtype "Journal Article"                                                 
## pubdate "2022 Sep 14"                                                     
## authors data.frame,3                                                      
##         36198396                                                                  
## title   "Historical and Contemporary Control Options Against Bed Bugs, Cimex spp."
## pubtype character,2                                                               
## pubdate "2022 Oct 5"                                                              
## authors data.frame,3                                                              
##         36194505                                                                                                         
## title   ""Bed bugs live in dirty places"-How Using Live Animals in Teaching Contributes to Reducing Stigma, " [truncated]
## pubtype "Journal Article"                                                                                                
## pubdate "2022 Dec"                                                                                                       
## authors data.frame,3                                                                                                     
##         36135475                                                                                                         
## title   "Comparative Efficacy of a Fungal Entomopathogen with a Broad Host Range against Two Human-Associate" [truncated]
## pubtype "Journal Article"                                                                                                
## pubdate "2022 Aug 26"                                                                                                    
## authors data.frame,3                                                                                                     
##         36127851                                                                                                         
## title   "'When the bedbugs come, that's another problem': exploring the lived experiences of bedbug infestat" [truncated]
## pubtype "Journal Article"                                                                                                
## pubdate "2022 Sep 20"                                                                                                    
## authors data.frame,3                                                                                                     
##         36124973                                                                                 
## title   "Effect of Bed Bug (Hemiptera: Cimicidae) Aldehydes on Efficacy of Fungal Biopesticides."
## pubtype "Journal Article"                                                                        
## pubdate "2022 Sep 19"                                                                            
## authors data.frame,3                                                                             
##         36086827                                                           
## title   "Histamine Excretion by the Common Bed Bug (Hemiptera: Cimicidae)."
## pubtype "Journal Article"                                                  
## pubdate "2022 Nov 16"                                                      
## authors data.frame,3                                                       
##         36000777                                                                                                         
## title   "Comparative Insecticide Uptake Characteristics of Chlorfenapyr Suggests an Additional Reason Why Be" [truncated]
## pubtype "Journal Article"                                                                                                
## pubdate "2022 Oct 12"                                                                                                    
## authors data.frame,3                                                                                                     
##         30844155       
## title   "Bedbug Bites."
## pubtype list,0         
## pubdate "2022 Jan"     
## authors data.frame,3   
##         35900244                                                         
## title   "Analysis of Patients With Bed Bugs in the Emergency Department."
## pubtype "Journal Article"                                                
## pubdate "2022 Jul-Sep 01"                                                
## authors data.frame,3                                                     
##         35895369                                                                                                         
## title   "Identification of Knockdown Resistance Mutations in the Cimex hemipterus (Hemiptera: Cimicidae) in " [truncated]
## pubtype "Journal Article"                                                                                                
## pubdate "2022 Jul 13"                                                                                                    
## authors data.frame,3                                                                                                     
##         35781682                            
## title   "Bed bugs on ship: a French review."
## pubtype character,2                         
## pubdate "2022"                              
## authors data.frame,3                        
##         35715692                                                                                                         
## title   "Effects of Wolbachia elimination and B-vitamin supplementation on bed bug development and reproduct" [truncated]
## pubtype "Journal Article"                                                                                                
## pubdate "2022 Jun 17"                                                                                                    
## authors data.frame,3                                                                                                     
##         35703110                                                                              
## title   "Morphometrics of the Tropical Bed Bug (Hemiptera: Cimicidae) From Cape Coast, Ghana."
## pubtype "Journal Article"                                                                     
## pubdate "2022 Sep 14"                                                                         
## authors data.frame,3                                                                          
##         35671220                                                                                                         
## title   "Quantification of Fecal Spot Production as a Measure of Environmental Contamination Based on Common" [truncated]
## pubtype "Journal Article"                                                                                                
## pubdate "2022 Oct 12"                                                                                                    
## authors data.frame,3                                                                                                     
##         35663609                                                                                                         
## title   "Staphylococcus aureus native mitral valve endocarditis associated with bed bug bites - A case repor" [truncated]
## pubtype list,0                                                                                                           
## pubdate "2022"                                                                                                           
## authors data.frame,3                                                                                                     
##         35640206                                                                                                         
## title   "The Efficacy of a Pyrethroid-impregnated Mattress Liner on Multiple International Strains of Cimex " [truncated]
## pubtype "Journal Article"                                                                                                
## pubdate "2022 May 29"                                                                                                    
## authors data.frame,3                                                                                                     
##         35639556                                                                                                         
## title   "Performance of Pyrethroid-Neonicotinoid Mixture Formulations Against Field-Collected Strains of the" [truncated]
## pubtype "Journal Article"                                                                                                
## pubdate "2022 May 26"                                                                                                    
## authors data.frame,3                                                                                                     
##         35623470                                                                                                         
## title   "Bed bug infestation in a French university hospital: control strategy, financial impact and perspec" [truncated]
## pubtype "Journal Article"                                                                                                
## pubdate "2022 Aug"                                                                                                       
## authors data.frame,3                                                                                                     
##         35617203                                                  
## title   "Spatiotemporal trends in bed bug metrics: New York City."
## pubtype "Journal Article"                                         
## pubdate "2022"                                                    
## authors data.frame,3                                              
##         35607829                                                                                                         
## title   "Comparative Efficacy of Superheated Dry Steam Application and Insecticide Spray against Common Bed " [truncated]
## pubtype "Journal Article"                                                                                                
## pubdate "2022 May 24"                                                                                                    
## authors data.frame,3                                                                                                     
##         35597739                                            
## title   "Cimex lectularius and Cimex hemipterus (bed bugs)."
## pubtype "Journal Article"                                   
## pubdate "2022 Oct"                                          
## authors data.frame,3                                        
##         35524788                                                                                                         
## title   "Geographical patterns and mechanisms of Cimex lectularius Linnaeus, 1758, and Cimex hemipterus Fabr" [truncated]
## pubtype character,3                                                                                                      
## pubdate "2022 Jul"                                                                                                       
## authors data.frame,3                                                                                                     
##         35495968                                          
## title   "Bed bug (Cimex spp.) colonization of human host."
## pubtype list,0                                            
## pubdate "2022 May"                                        
## authors data.frame,3                                      
##         35391489                                                                                                         
## title   "Prevalence of Cockroaches, Bed Bugs, and House Mice in Low-Income Housing and Evaluation of Baits f" [truncated]
## pubtype "Journal Article"                                                                                                
## pubdate "2022 May 11"                                                                                                    
## authors data.frame,3                                                                                                     
##         35384689                                                                                                         
## title   "A Comparative Study of Body Lice and Bed Bugs Reveals Factors Potentially Involved in Differential " [truncated]
## pubtype "Journal Article"                                                                                                
## pubdate "2022 May 19"                                                                                                    
## authors data.frame,3                                                                                                     
##         35348633                                                                                                         
## title   "Elevated Temperature Reduces Overwintering Survival of an Avian Ectoparasite, the Swallow Bug (Hemi" [truncated]
## pubtype "Journal Article"                                                                                                
## pubdate "2022 Apr 22"                                                                                                    
## authors data.frame,3                                                                                                     
##         35318403                                                                                                         
## title   "Bacterial symbionts influence host susceptibility to fenitrothion and imidacloprid in the obligate " [truncated]
## pubtype "Journal Article"                                                                                                
## pubdate "2022 Mar 22"                                                                                                    
## authors data.frame,3                                                                                                     
##         35286393                                                                                                         
## title   "Morphological, Molecular and MALDI-TOF MS Identification of Bedbugs and Associated Wolbachia Specie" [truncated]
## pubtype "Journal Article"                                                                                                
## pubdate "2022 May 11"                                                                                                    
## authors data.frame,3                                                                                                     
##         35274683                                                                                                         
## title   "Morphological and Molecular Identification of Cimex hemipterus Fabricius, 1803 (Hemiptera: Cimicida" [truncated]
## pubtype "Journal Article"                                                                                                
## pubdate "2022 May 11"                                                                                                    
## authors data.frame,3                                                                                                     
##         35199182                                                                                                         
## title   "Characteristic Linear and Zigzag Purpuric Lesions in a Patient with Long-term and Repeated Exposure" [truncated]
## pubtype "Journal Article"                                                                                                
## pubdate "2022 Mar 8"                                                                                                     
## authors data.frame,3                                                                                                     
##         34981990                                                                       
## title   "A Francisella tularensis-Like Bacterium in Tropical Bed Bugs from Madagascar."
## pubtype "Journal Article"                                                              
## pubdate "2022 Jan"                                                                     
## authors data.frame,3                                                                   
##         34897482                                                                                                         
## title   "Procurement Competence and Framework Agreements for Upgraded Bed Bug Control [Cimex lectularius (He" [truncated]
## pubtype "Journal Article"                                                                                                
## pubdate "2022 Feb 9"                                                                                                     
## authors data.frame,3                                                                                                     
##         34880281                                                                     
## title   "Human skin triglycerides prevent bed bug (Cimex lectularius L.) arrestment."
## pubtype "Journal Article"                                                            
## pubdate "2021 Dec 8"                                                                 
## authors data.frame,3                                                                 
##         34838119                                                                                                         
## title   "Molecular and MALDI-TOF MS identification of swallow bugs Cimex hirundinis (Heteroptera: Cimicidae)" [truncated]
## pubtype "Journal Article"                                                                                                
## pubdate "2021 Nov 27"                                                                                                    
## authors data.frame,3                                                                                                     
##         34821827                                                                                                         
## title   "The Impact of Bedbug (Cimex spp.) Bites on Self-Rated Health and Average Hours of Sleep per Day: A " [truncated]
## pubtype "Journal Article"                                                                                                
## pubdate "2021 Nov 14"                                                                                                    
## authors data.frame,3                                                                                                     
##         34787287                                                                                                         
## title   "Evaluation of the insecticide susceptibility profile in Cimex lectularius (Hemiptera: Cimicidae) in" [truncated]
## pubtype "Journal Article"                                                                                                
## pubdate "2021"                                                                                                           
## authors data.frame,3                                                                                                     
##         34765758                                                                                                         
## title   "Investigating the association of bed bugs with infectious diseases: A retrospective case-control st" [truncated]
## pubtype "Journal Article"                                                                                                
## pubdate "2021 Oct"                                                                                                       
## authors data.frame,3                                                                                                     
##         34758597          
## title   "[Bed bug bites]."
## pubtype "Journal Article" 
## pubdate "2021 Nov 9"      
## authors data.frame,3      
##         34693975                                                                                                         
## title   "Multiple Mechanisms Conferring Broad-Spectrum Insecticide Resistance in the Tropical Bed Bug (Hemip" [truncated]
## pubtype "Journal Article"                                                                                                
## pubdate "2021 Dec 6"                                                                                                     
## authors data.frame,3                                                                                                     
##         34644597                                                                                                         
## title   "Time- and tissue-specific antimicrobial activity of the common bed bug in response to blood feeding" [truncated]
## pubtype "Journal Article"                                                                                                
## pubdate "2021 Nov-Dec"                                                                                                   
## authors data.frame,3                                                                                                     
##         34639855                                                                                          
## title   "A Survey of Potentially Pathogenic-Incriminated Arthropod Vectors of Health Concern in Botswana."
## pubtype "Journal Article"                                                                                 
## pubdate "2021 Oct 8"                                                                                      
## authors data.frame,3                                                                                      
##         34523872                                                                                      
## title   "Pilot study: specific immunotherapy in patients with Papular urticaria by Cimex lectularius."
## pubtype character,2                                                                                   
## pubdate "2022 Nov"                                                                                    
## authors data.frame,3                                                                                  
##         34521460                                                                                                         
## title   "High levels of pyrethroid resistance and super-kdr mutations in the populations of tropical bed bug" [truncated]
## pubtype "Journal Article"                                                                                                
## pubdate "2021 Sep 14"                                                                                                    
## authors data.frame,3                                                                                                     
##         34498401                                         
## title   "Respiratory diseases in patients with bed bugs."
## pubtype "Journal Article"                                
## pubdate "2022 Jan"                                       
## authors data.frame,3                                     
##         34486193                                                                                                         
## title   "Seminal fluid and sperm diluent affect sperm metabolism in an insect: Evidence from NAD(P)H and fla" [truncated]
## pubtype "Journal Article"                                                                                                
## pubdate "2022 Jan"                                                                                                       
## authors data.frame,3                                                                                                     
##         34479609                                                                                                         
## title   "Latrocimicinae completes the phylogeny of Cimicidae: meeting old morphologic data rather than moder" [truncated]
## pubtype "Journal Article"                                                                                                
## pubdate "2021 Sep 3"                                                                                                     
## authors data.frame,3                                                                                                     
##         34468070                                                                                                         
## title   "Characterization of heat exposure-associated escape behaviors and HSP gene expression in bed bugs (" [truncated]
## pubtype "Journal Article"                                                                                                
## pubdate "2022 Jan"                                                                                                       
## authors data.frame,3                                                                                                     
##         34454015                                                                                                         
## title   "Common substitution mutation F348Y of acetylcholinesterase gene contributes to organophosphate and " [truncated]
## pubtype "Journal Article"                                                                                                
## pubdate "2021 Nov"                                                                                                       
## authors data.frame,3                                                                                                     
##         34434117                                                           
## title   "The Olfactory Chemosensation of Hematophagous Hemipteran Insects."
## pubtype character,2                                                        
## pubdate "2021"                                                             
## authors data.frame,3                                                       
##         34410423                                                                                                         
## title   "Behavioral Response of the Tropical Bed Bug, Cimex hemipterus (Hemiptera: Cimicidae) to Carbon Diox" [truncated]
## pubtype "Journal Article"                                                                                                
## pubdate "2021 Oct 13"                                                                                                    
## authors data.frame,3                                                                                                     
##         34330972                                                                                                         
## title   "Male diet affects female fitness and sperm competition in human- and bat-associated lineages of the" [truncated]
## pubtype "Journal Article"                                                                                                
## pubdate "2021 Jul 30"                                                                                                    
## authors data.frame,3                                                                                                     
##         34327537                                                                                                         
## title   "Bed Bugs (Cimex spp. (Hemiptera: Cimicidae)) as Permanent Ectoparasites: A Rare But Potentially Sig" [truncated]
## pubtype "Letter"                                                                                                         
## pubdate "2021 Nov 9"                                                                                                     
## authors data.frame,3                                                                                                     
##         34312971                                                                                                         
## title   "Detection and monitoring of bed bugs (Hemiptera: Cimicidae): review of the underlying science, exis" [truncated]
## pubtype character,2                                                                                                      
## pubdate "2021 Dec"                                                                                                       
## authors data.frame,3                                                                                                     
##         34272799                                                                                                         
## title   "Cuticle thickening associated with fenitrothion and imidacloprid resistance and influence of voltag" [truncated]
## pubtype "Journal Article"                                                                                                
## pubdate "2021 Nov"                                                                                                       
## authors data.frame,3                                                                                                     
##         34202079                                                                                             
## title   "Bed Bugs (Hemiptera: Cimicidae) Population Diversity and First Record of Cimex hemipterus in Paris."
## pubtype "Journal Article"                                                                                    
## pubdate "2021 Jun 25"                                                                                        
## authors data.frame,3                                                                                         
##         34185547                                                                                                         
## title   "Pesticides Misused for Bed Bug Control: Comparing Professional and Nonprofessional Applications Rep" [truncated]
## pubtype "Journal Article"                                                                                                
## pubdate "2021 Aug"                                                                                                       
## authors data.frame,3                                                                                                     
##         34184043                                                         
## title   "Toxicity of Methyl Benzoate and Analogs to Adult Aedes aegypti."
## pubtype "Journal Article"                                                
## pubdate "2021 Jun 1"                                                     
## authors data.frame,3                                                     
##         34136318                                                                               
## title   "Associations Between Bed Bugs and Mental Illness Among Emergency Department Patients."
## pubtype "Journal Article"                                                                      
## pubdate "2021 May 14"                                                                          
## authors data.frame,3                                                                           
##         34074914                                                                                                         
## title   "Common pediatric infestations: update on diagnosis and treatment of scabies, head lice, and bed bug" [truncated]
## pubtype character,2                                                                                                      
## pubdate "2021 Aug 1"                                                                                                     
## authors data.frame,3                                                                                                     
##         33993977                                                                                                         
## title   "Plant essential oil constituents enhance deltamethrin toxicity in a resistant population of bed bug" [truncated]
## pubtype "Journal Article"                                                                                                
## pubdate "2021 Jun"                                                                                                       
## authors data.frame,3                                                                                                     
##         33948981                                                                                      
## title   "Early evidence of establishment of the tropical bedbug (Cimex hemipterus) in Central Europe."
## pubtype "Journal Article"                                                                             
## pubdate "2021 Sep"                                                                                    
## authors data.frame,3                                                                                  
##         33899212                              
## title   "Cutaneous reactions to bedbug bites."
## pubtype "Letter"                              
## pubdate "2022 Feb"                            
## authors data.frame,3                          
##         33899103                                                                                                         
## title   "The Common Bed Bug (Hemiptera: Cimicidae) Does Not Commonly Use Canines and Felines as a Host in Lo" [truncated]
## pubtype "Journal Article"                                                                                                
## pubdate "2021 Nov 9"                                                                                                     
## authors data.frame,3                                                                                                     
##         33884648                                                                                  
## title   "Experimental infection of bed bugs (Cimex lectularius L.) with Burkholderia multivorans."
## pubtype "Journal Article"                                                                         
## pubdate "2021 Sep"                                                                                
## authors data.frame,3                                                                              
##         33875727                                                                                                         
## title   "Characterization of bacterial communities associated with blood-fed and starved tropical bed bugs, " [truncated]
## pubtype "Journal Article"                                                                                                
## pubdate "2021 Apr 19"                                                                                                    
## authors data.frame,3                                                                                                     
##         33872787                                                   
## title   "Rapid control method of bed bugs infestation by freezing."
## pubtype "Letter"                                                   
## pubdate "2021 Jul-Aug"                                             
## authors data.frame,3                                               
##         33831435                                                                        
## title   "Bedbug salivation patterns during hematophagy in the skin of a mammalian host."
## pubtype "Journal Article"                                                               
## pubdate "2021 May-Jun"                                                                  
## authors data.frame,3                                                                    
##         33822124                                                                                                         
## title   "Assessment of Tropical Bed Bug (Hemiptera: Cimicidae), Infestations in Cape Coast, Ghana: Household" [truncated]
## pubtype "Journal Article"                                                                                                
## pubdate "2021 Jul 16"                                                                                                    
## authors data.frame,3                                                                                                     
##         33822102                                                              
## title   "Resistance to Fipronil in the Common Bed Bug (Hemiptera: Cimicidae)."
## pubtype "Journal Article"                                                     
## pubdate "2021 Jul 16"                                                         
## authors data.frame,3                                                          
##         33802315                                                                                                         
## title   "Effects of Chemical Insecticide Residues and Household Surface Type on a Beauveria bassiana-Based B" [truncated]
## pubtype "Journal Article"                                                                                                
## pubdate "2021 Mar 3"                                                                                                     
## authors data.frame,3                                                                                                     
##         33704797                                              
## title   "Association between bed bugs and allergic reactions."
## pubtype "Journal Article"                                     
## pubdate "2021 Jul"                                            
## authors data.frame,3                                          
##         33704449                                                                                          
## title   "The Behavioral Response to Heat in the Common Bed Bug, Cimex lectularius (Hemiptera: Cimicidae)."
## pubtype "Journal Article"                                                                                 
## pubdate "2021 Jul 16"                                                                                     
## authors data.frame,3                                                                                      
##         33704428                                                                                                         
## title   "Field Evaluations of Sulfuryl Fluoride Fumigation for Control of the Common Bed Bug (Hemiptera: Cim" [truncated]
## pubtype "Journal Article"                                                                                                
## pubdate "2021 Apr 13"                                                                                                    
## authors data.frame,3                                                                                                     
##         33670065                                                                   
## title   "Behavioral Responses of the Common Bed Bug to Essential Oil Constituents."
## pubtype "Journal Article"                                                          
## pubdate "2021 Feb 21"                                                              
## authors data.frame,3                                                               
##         33644237                                                                                                         
## title   "The Phylogenetic Analysis of Cimex hemipterus (Hemiptera: Cimicidae) Isolated from Different Region" [truncated]
## pubtype "Journal Article"                                                                                                
## pubdate "2020 Sep"                                                                                                       
## authors data.frame,3                                                                                                     
##         33599802                     
## title   "[Parasitoses in childhood]."
## pubtype character,2                  
## pubdate "2021 Mar"                   
## authors data.frame,3                 
##         33559752                                                                                                         
## title   "Molecular analysis of the blood meals and bacterial communities of bed bugs (Cimex lectularius L.) " [truncated]
## pubtype "Journal Article"                                                                                                
## pubdate "2021 Apr"                                                                                                       
## authors data.frame,3                                                                                                     
##         33557124                                                                                                         
## title   "Magnitude and Spread of Bed Bugs (Cimex lectularius) throughout Ohio (USA) Revealed by Surveys of P" [truncated]
## pubtype "Journal Article"                                                                                                
## pubdate "2021 Feb 4"                                                                                                     
## authors data.frame,3                                                                                                     
##         33533822                                                                                                         
## title   "New pandemic, old bugs: A case of cimicosis (Bed Bug) in a neglected elderly patient during the cor" [truncated]
## pubtype "Journal Article"                                                                                                
## pubdate "2021"                                                                                                           
## authors data.frame,3                                                                                                     
##         33528356                                                                                                         
## title   "Insecticidal efficacy of afoxolaner against bedbugs, Cimex lectularius, when administered orally to" [truncated]
## pubtype "Journal Article"                                                                                                
## pubdate "2021"                                                                                                           
## authors data.frame,3                                                                                                     
##         33479298                                                                                                         
## title   "Mating and starvation modulate feeding and host-seeking responses in female bed bugs, Cimex lectula" [truncated]
## pubtype "Journal Article"                                                                                                
## pubdate "2021 Jan 21"                                                                                                    
## authors data.frame,3                                                                                                     
##         33424811                                                                                                         
## title   "Transmission, Tropism, and Biological Impacts of Torix Rickettsia in the Common Bed Bug Cimex lectu" [truncated]
## pubtype "Journal Article"                                                                                                
## pubdate "2020"                                                                                                           
## authors data.frame,3                                                                                                     
##         33420500                                                                 
## title   "Methods for Testing Repellents Against Bed Bugs (Hemiptera: Cimicidae)."
## pubtype "Journal Article"                                                        
## pubdate "2021 Feb 9"                                                             
## authors data.frame,3                                                             
##         33419204                                                                                                         
## title   "Widespread Mutations in Voltage-Gated Sodium Channel Gene of Cimex lectularius (Hemiptera: Cimicida" [truncated]
## pubtype "Journal Article"                                                                                                
## pubdate "2021 Jan 6"                                                                                                     
## authors data.frame,3                                                                                                     
##         33378530                                                                                                         
## title   "Four Species of Under-reported Parasitic Arthropods in Mexico and their Potential Role as Vectors o" [truncated]
## pubtype "Journal Article"                                                                                                
## pubdate "2020 Nov 12"                                                                                                    
## authors data.frame,3                                                                                                     
##         33310450                                                                                                         
## title   "Detection of target-site and metabolic resistance to pyrethroids in the bed bug Cimex lectularius i" [truncated]
## pubtype "Journal Article"                                                                                                
## pubdate "2020 Dec"                                                                                                       
## authors data.frame,3                                                                                                     
##         33282107                                                                                                         
## title   "ATYPICAL LINEAR CONFIGURATION OF BEDBUG BITES IN AN EIGHT-YEAR-OLD BOY: A Case Report and Overview " [truncated]
## pubtype list,0                                                                                                           
## pubdate "2020 Jun"                                                                                                       
## authors data.frame,3                                                                                                     
##         33239286                                                                                 
## title   "The immune and circulatory systems are functionally integrated across insect evolution."
## pubtype "Journal Article"                                                                        
## pubdate "2020 Nov"                                                                               
## authors data.frame,3                                                                             
##         33221110                              
## title   "Bed bugs are associated with anemia."
## pubtype "Journal Article"                     
## pubdate "2021 Aug"                            
## authors data.frame,3                          
##         33210364                                                                                                         
## title   "Modification of footed pajamas to confirm arthropod bites: The Modified Onesie Biting Bug Assessmen" [truncated]
## pubtype "Journal Article"                                                                                                
## pubdate "2021 Mar"                                                                                                       
## authors data.frame,3                                                                                                     
##         33167323                                                                                          
## title   "Ontogenesis of Aldehyde Pheromones in Two Synanthropic Bed Bug Species (Heteroptera: Cimicidae)."
## pubtype "Journal Article"                                                                                 
## pubdate "2020 Nov 5"                                                                                      
## authors data.frame,3                                                                                      
##         33159287                                                                                                         
## title   "Isolation and characterization of human DNA recovered from Cimex hemipterus (F.) (Hemiptera:Cimicid" [truncated]
## pubtype "Journal Article"                                                                                                
## pubdate "2020 Dec"                                                                                                       
## authors data.frame,3                                                                                                     
##         33144950                                                                                                         
## title   "Reproductive compatibility among populations and host-associated lineages of the common bed bug (Ci" [truncated]
## pubtype "Journal Article"                                                                                                
## pubdate "2020 Oct"                                                                                                       
## authors data.frame,3                                                                                                     
##         33140831                                                                     
## title   "Repellency of Novel Catnip Oils Against the Bed Bug (Hemiptera: Cimicidae)."
## pubtype "Journal Article"                                                            
## pubdate "2021 Mar 12"                                                                
## authors data.frame,3

3. Create a plot to see how this topic has been reported on over a particular time span.

# create an object for searching in glue
year <- 1950:2022
clec_search <- glue("cimex lectularius[ORGN] AND {year}[PDAT]")

# create a second search to compare change over time in publications

search_counts <- tibble(year = year,
                        clec_search = clec_search) %>%
  mutate(C_lec = map_dbl(clec_search, ~entrez_search(db = "pubmed", 
                                                    term = .x)$count))

# plot the number of publications for AMV and tomato viruses from 1950 to 2022
search_counts %>%
  select(year, C_lec) %>%
  pivot_longer(-year) %>%
  ggplot(aes(x = year,
             y = value,
             group = name,
             color = name))+
  geom_line(size = 1)+
  geom_smooth(color = "light blue")+
  theme_bw()
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'