# vectorsurvR

## VectorSurv

VectorSurv provides public health agencies the tools to manage, visualize and analyze the spread of vector-borne diseases and make informed decisions to protect public health.

The ‘vectorsurvR’ package is intended for users of VectorSurv, a public health vector borne disease surveillance system. The package contains functions tailored to data retrieved from the VectorSurv database. A valid VectorSurv username and password is required for data retrieval. Those without agency access can use sample datasets in place of real data. This documentation covers the functions in ‘vectorsurvR’ and introduces users to methods of R programming. The purpose of this documentation is to introduce and guide users with limited programming experience.

To install package from CRAN (recommended) run:

`install.packages("vectorsurvR")`

Or install the developing version from our github run:

`devtools::install_github("UCD-DART/vectorsurvR")`

Then load the package for use.

## Data Retrieval

getToken()

Description

`getToken()` returns a token needed to run `getArthroCollections()` and `getPools()`. The function prompts users for their Gateway credentials. If credentials are accepted, the function returns a user token needed to obtain data and a list of agencies the user has access to.

Usage

`getToken()`

Arguments

    token = getToken()

getArthroCollections(…)

Description

`getArthroCollections(...)` obtains collections data for a range of years. It prompts the user for their Gateway username and password before retrieving the associated data. You can only retrieve data from agencies linked to your Gateway account.

Usage

`getArthroCollections(token,start_year, end_year, arthropod, agency_ids = NULL)`

Arguments

- token: access token retrieved from `getToken()`
- start_year: Beginning of year range
- end_year: End of year range
- arthropod: Type of pools to retrieve: ‘tick’ , ‘mosquito’
- agency_ids: Default to NULL returns data for all available agencies, specifying a vector of agency ids will return data for specific agencies. This parameter is best used by accounts with access to multiple agencies.

    #Example
    collections = getArthroCollections(token, 2022,2023, 'mosquito',55)

getPools(…)

Description

`getPools()` similar to `getArthroCollections()` obtains pools on a year range (start_year, end_year) after supplying a valid token retrieved from getToken(). `getPools()` can retrieve data for both mosquito and tick pools.

Usage

`getPools(token, start_year, end_year, arthropod, agency_ids = NULL)` Arguments

- token: access token retrieved from `getToken()`
- start_year: Beginning of year range
- end_year: End of year range
- arthropod: Type of collections to retrieve: ‘tick’ , ‘mosquito’
- agency_ids: Default to NULL returns data for all available agencies, specifying a vector of agency ids will return data for specific agencies. This parameter is best used by accounts with access to multiple agencies.

    #Example
    pools = getPools(token, 2022,2023, 'mosquito')

## Write Data to file

You can save retrieved data as a .csv file in your current directory using `write.csv()`. That same data can be retrieved using `read.csv()`. Writing data to a .csv can make the rendering process more efficient when generating reports in R. We recommend that you write the data pulled from our API into a csv and then load that data when generating reports.

    #creates a file named "collections_18_23.csv" in your current directory
    write.csv(x = collections, file = "collections_22_23.csv")

    #loads collections data
    collections = read.csv("collections_22_23.csv")

## Sample Data

The ‘vectorsurvR’ package comes with two sample datasets which can be used in place of real collections and pools data. `sample_collections` and `sample_pools` will be used for example purposes in this document.

## Data Processing

Data can be subset to contain columns of interest. Subsetting can also be used to reorder the columns in a data frame.Do not subset collections or pools data before inputting them into VectorSurv calculator functions to avoid losing essential columns. It is recommended to subset after calculations are complete and before inputting into a table generator. Remember, subsetting, filtering, grouping and summarising will not change the value of the data unless it is reassigned to the same variable name. We recommend creating a new variable for processed data.

### Subsetting

    #Subset using column names or index number

    colnames(sample_collections) #displays column names and associated index
    #>  [1] "agency_code"          "collection_id"        "collection_date"
    #>  [4] "surv_year"            "species_display_name" "sex_type"
    #>  [7] "trap_acronym"         "trap_problem_bit"     "num_trap"
    #> [10] "trap_nights"          "num_count"            "site_code"
    #> [13] "agency_id"            "county"               "collection_longitude"
    #> [16] "collection_latitude"  "spatial_feature"

    #Subseting by name
    head(sample_collections[c("collection_date", "species_display_name", "num_count")])
    #> # A tibble: 6 × 3
    #>   collection_date species_display_name num_count
    #>   <date>          <chr>                    <int>
    #> 1 2015-01-22      Cx pipiens                   1
    #> 2 2015-01-10      Cx stigmatosoma              2
    #> 3 2015-01-02      Cs inornata                  1
    #> 4 2015-01-02      Cs inornata                 22
    #> 5 2015-01-29      Cs inornata                 38
    #> 6 2015-01-29      Cs incidens                  2

    #by index
    head(sample_collections[c(2, 4, 10)])
    #> # A tibble: 6 × 3
    #> # Groups:   surv_year [1]
    #>   collection_id surv_year trap_nights
    #>           <int>     <dbl>       <int>
    #> 1       1374818      2015           6
    #> 2       1368247      2015           8
    #> 3       1366915      2015          15
    #> 4       1366929      2015          15
    #> 5       1377676      2015           7
    #> 6       1377690      2015           7

    #to save a subset
    collections_subset = sample_collections[c(2, 4, 10)]

### Filtering and subsetting in ‘dplyr’

‘dplyr’ is a powerful package for filtering and sub-setting data. It follows logic similar to SQL queries.

For more information on data manipulation using ‘dplyr’ Click Here

‘dplyr’ utilizes the pipe operator `%>%` to send data into functions. The `head()` function returns the first few rows of data, specifying `head(1)` tells the software to return only the first row for viewing purposes. Remove `head()` to see all the data or reassign the data to a new variable.

    #NOTE: library was loaded above
    library(dplyr)

    #Subsetting columns with 'select()'
    sample_collections %>%
      dplyr::select(collection_date, species_display_name, num_count) %>% head()
    #> Adding missing grouping variables: `surv_year`
    #> # A tibble: 6 × 4
    #> # Groups:   surv_year [1]
    #>   surv_year collection_date species_display_name num_count
    #>       <dbl> <date>          <chr>                    <int>
    #> 1      2015 2015-01-22      Cx pipiens                   1
    #> 2      2015 2015-01-10      Cx stigmatosoma              2
    #> 3      2015 2015-01-02      Cs inornata                  1
    #> 4      2015 2015-01-02      Cs inornata                 22
    #> 5      2015 2015-01-29      Cs inornata                 38
    #> 6      2015 2015-01-29      Cs incidens                  2

Below are more examples for filtering data.

    #filtering with dplyr 'filter'
    collections_pip = sample_collections %>%
      filter(species_display_name == "Cx pipiens")

    #filtering multiple arguments using '%in%'
    collections_pip_tar = sample_collections %>%
      filter(species_display_name %in% c("Cx pipiens", "Cx tarsalis"))

### Grouping and Summarising

In addition to filtering and sub-setting, data can be group by variables and summarized.

    #groups by species and collection date and sums the number counted

    sample_collections %>%
      group_by(collection_date, species_display_name) %>%
      summarise(sum_count = sum(num_count, na.rm = T)) %>%
      head()
    #> `summarise()` has grouped output by 'collection_date'. You can override using
    #> the `.groups` argument.
    #> # A tibble: 6 × 3
    #> # Groups:   collection_date [2]
    #>   collection_date species_display_name sum_count
    #>   <date>          <chr>                    <int>
    #> 1 2015-01-02      Cs incidens                 15
    #> 2 2015-01-02      Cs inornata                 88
    #> 3 2015-01-02      Cx pipiens                  46
    #> 4 2015-01-02      Cx tarsalis                  3
    #> 5 2015-01-10      An freeborni                 4
    #> 6 2015-01-10      Cs incidens                  1

    #groups by species and collection date and takes the average the number counted

    sample_collections %>%
      group_by(collection_date, species_display_name) %>%
      summarise(avg_count = mean(num_count, na.rm = T)) %>%
      head()
    #> `summarise()` has grouped output by 'collection_date'. You can override using
    #> the `.groups` argument.
    #> # A tibble: 6 × 3
    #> # Groups:   collection_date [2]
    #>   collection_date species_display_name avg_count
    #>   <date>          <chr>                    <dbl>
    #> 1 2015-01-02      Cs incidens                5
    #> 2 2015-01-02      Cs inornata                8
    #> 3 2015-01-02      Cx pipiens                11.5
    #> 4 2015-01-02      Cx tarsalis                1.5
    #> 5 2015-01-10      An freeborni               4
    #> 6 2015-01-10      Cs incidens                1

### Pivoting

Data can be manipulated into long and wide (spreadsheet) forms using `pivot_wider()` and `pivot_longer()` from the ‘tidyr’ package. By default data from the API is in long form. Here we pivot on species and sex condition names using num_count as values. The end result is data with num_count values in the columns named species_sex. For more on pivoting see `??pivot_longer()` and `??pivot_wider()`.

    library(tidyr)

    collections_wide = pivot_wider(
      sample_collections,
      names_from = c("species_display_name","sex_type"),
      values_from = "num_count"
    )
    #> Warning: Values from `num_count` are not uniquely identified; output will contain
    #> list-cols.
    #> • Use `values_fn = list` to suppress this warning.
    #> • Use `values_fn = {summary_fun}` to summarise duplicates.
    #> • Use the following dplyr code to identify duplicates.
    #>   {data} |>
    #>   dplyr::summarise(n = dplyr::n(), .by = c(agency_code, collection_id,
    #>   collection_date, surv_year, trap_acronym, trap_problem_bit, num_trap,
    #>   trap_nights, site_code, agency_id, county, collection_longitude,
    #>   collection_latitude, spatial_feature, species_display_name, sex_type)) |>
    #>   dplyr::filter(n > 1L)

## Calculations

### Abundance

getAbundance(…)

Description

`getAbundance()` uses any amount of mosquito collections data to calculate the abundance for the specified parameters. The function calculates using the methods of the Gateway Abundance calculator.

Usage

`getAbundance(collections,interval, species = NULL, trap = NULL, separate_by = NULL)`

Arguments

- collections: Mosquito collections data retrieved from `getArthroCollections(...)`
- interval: Calculation interval for abundance, accepts “collection_date”,“Biweek”,“Week”, and “Month.
- species: Species filter for calculating abundance. Species_display_name is the accepted notation. To see a list of species present in your data run `unique(collections$species_display_name)`. If species is unspecified, the default `NULL` will return data for all species in data.
- trap: Trap filter for calculating abundance. Trap_acronym is the is the accepted notation. Run `unique(collections$trap_acronym)` to see trap types present in your data. If trap is unspecified, the default `NULL` will return data for all trap types.
- separate_by:Separate/group the calculation by ‘trap’,‘species’ or ‘agency’. Default NULL does not separate calculation

    getAbundance(
      sample_collections,
      interval = "Biweek",
      species = c("Cx tarsalis", "Cx pipiens"),
      trap = "CO2",
      separate_by = NULL
    )
    #>    Agency Year Biweek   County                 Species Count TrapEvents Trap
    #> 1  AGENCY 2021      4 County 1              Cx pipiens    10          3  CO2
    #> 2  AGENCY 2021      7 County 1              Cx pipiens     4          3  CO2
    #> 3  AGENCY 2021      8 County 1 Cx pipiens, Cx tarsalis    23         10  CO2
    #> 4  AGENCY 2021     10 County 1              Cx pipiens     9          5  CO2
    #> 5  AGENCY 2021     11 County 1 Cx pipiens, Cx tarsalis    17         13  CO2
    #> 6  AGENCY 2021     12 County 1 Cx pipiens, Cx tarsalis   474         10  CO2
    #> 7  AGENCY 2021     13 County 1              Cx pipiens   338         12  CO2
    #> 8  AGENCY 2021     14 County 1 Cx pipiens, Cx tarsalis    79          9  CO2
    #> 9  AGENCY 2021     15 County 1 Cx pipiens, Cx tarsalis  3137         10  CO2
    #> 10 AGENCY 2021     16 County 1 Cx pipiens, Cx tarsalis  2265         12  CO2
    #> 11 AGENCY 2021     17 County 1 Cx pipiens, Cx tarsalis    23          8  CO2
    #> 12 AGENCY 2021     18 County 1             Cx tarsalis    49          6  CO2
    #> 13 AGENCY 2021     19 County 1             Cx tarsalis    35         10  CO2
    #> 14 AGENCY 2021     20 County 1             Cx tarsalis    39         10  CO2
    #> 15 AGENCY 2021     21 County 1 Cx pipiens, Cx tarsalis    16          6  CO2
    #> 16 AGENCY 2020      9 County 1             Cx tarsalis    56          4  CO2
    #> 17 AGENCY 2020     10 County 1 Cx pipiens, Cx tarsalis    24          6  CO2
    #> 18 AGENCY 2020     11 County 1 Cx pipiens, Cx tarsalis   204         15  CO2
    #> 19 AGENCY 2020     12 County 1 Cx pipiens, Cx tarsalis   251         10  CO2
    #> 20 AGENCY 2020     13 County 1 Cx pipiens, Cx tarsalis   208         14  CO2
    #> 21 AGENCY 2020     14 County 1 Cx pipiens, Cx tarsalis  2584         12  CO2
    #> 22 AGENCY 2020     15 County 1 Cx pipiens, Cx tarsalis    38          8  CO2
    #> 23 AGENCY 2020     16 County 1 Cx pipiens, Cx tarsalis   345          8  CO2
    #> 24 AGENCY 2020     17 County 1 Cx pipiens, Cx tarsalis  1670         10  CO2
    #> 25 AGENCY 2020     18 County 1             Cx tarsalis    79          7  CO2
    #> 26 AGENCY 2020     19 County 1 Cx pipiens, Cx tarsalis   187         13  CO2
    #> 27 AGENCY 2020     20 County 1             Cx tarsalis    43         12  CO2
    #> 28 AGENCY 2020     21 County 1 Cx pipiens, Cx tarsalis    61         13  CO2
    #> 29 AGENCY 2020     22 County 1 Cx pipiens, Cx tarsalis    12         11  CO2
    #> 30 AGENCY 2020     23 County 1 Cx pipiens, Cx tarsalis     9          8  CO2
    #> 31 AGENCY 2020     24 County 1              Cx pipiens     3          4  CO2
    #> 32 AGENCY 2019      4 County 1              Cx pipiens     3          1  CO2
    #> 33 AGENCY 2019      9 County 1 Cx pipiens, Cx tarsalis    18          9  CO2
    #> 34 AGENCY 2019     10 County 1 Cx pipiens, Cx tarsalis    22          7  CO2
    #> 35 AGENCY 2019     11 County 1 Cx pipiens, Cx tarsalis   564         16  CO2
    #> 36 AGENCY 2019     12 County 1              Cx pipiens    51          4  CO2
    #> 37 AGENCY 2019     13 County 1 Cx pipiens, Cx tarsalis   881         13  CO2
    #> 38 AGENCY 2019     14 County 1 Cx pipiens, Cx tarsalis   266          6  CO2
    #> 39 AGENCY 2019     15 County 1 Cx pipiens, Cx tarsalis  4239         16  CO2
    #> 40 AGENCY 2019     16 County 1 Cx pipiens, Cx tarsalis    68         14  CO2
    #> 41 AGENCY 2019     17 County 1 Cx pipiens, Cx tarsalis    77          7  CO2
    #> 42 AGENCY 2019     18 County 1 Cx pipiens, Cx tarsalis   262          6  CO2
    #> 43 AGENCY 2019     19 County 1 Cx pipiens, Cx tarsalis    54          9  CO2
    #> 44 AGENCY 2019     20 County 1 Cx pipiens, Cx tarsalis   214         12  CO2
    #> 45 AGENCY 2019     21 County 1             Cx tarsalis    37          9  CO2
    #> 46 AGENCY 2018     10 County 1 Cx pipiens, Cx tarsalis   304         16  CO2
    #> 47 AGENCY 2018     11 County 1 Cx pipiens, Cx tarsalis    96         16  CO2
    #> 48 AGENCY 2018     12 County 1 Cx pipiens, Cx tarsalis    90         16  CO2
    #> 49 AGENCY 2018     13 County 1 Cx pipiens, Cx tarsalis  4016         13  CO2
    #> 50 AGENCY 2018     14 County 1 Cx pipiens, Cx tarsalis   486          9  CO2
    #> 51 AGENCY 2018     15 County 1 Cx pipiens, Cx tarsalis   147         11  CO2
    #> 52 AGENCY 2018     16 County 1 Cx pipiens, Cx tarsalis  1611         14  CO2
    #> 53 AGENCY 2018     17 County 1 Cx pipiens, Cx tarsalis    41         13  CO2
    #> 54 AGENCY 2018     18 County 1 Cx pipiens, Cx tarsalis   211         13  CO2
    #> 55 AGENCY 2018     19 County 1              Cx pipiens   125         10  CO2
    #> 56 AGENCY 2018     20 County 1 Cx pipiens, Cx tarsalis    47         10  CO2
    #> 57 AGENCY 2018     21 County 1             Cx tarsalis    11          9  CO2
    #> 58 AGENCY 2017      8 County 1              Cx pipiens    10          4  CO2
    #> 59 AGENCY 2017      9 County 1 Cx pipiens, Cx tarsalis    18          8  CO2
    #> 60 AGENCY 2017     10 County 1 Cx pipiens, Cx tarsalis   149         16  CO2
    #> 61 AGENCY 2017     11 County 1 Cx pipiens, Cx tarsalis   351         13  CO2
    #> 62 AGENCY 2017     12 County 1 Cx pipiens, Cx tarsalis    65         17  CO2
    #> 63 AGENCY 2017     13 County 1 Cx pipiens, Cx tarsalis   209         19  CO2
    #> 64 AGENCY 2017     14 County 1 Cx pipiens, Cx tarsalis   410         23  CO2
    #> 65 AGENCY 2017     15 County 1 Cx pipiens, Cx tarsalis   669         10  CO2
    #> 66 AGENCY 2017     16 County 1 Cx pipiens, Cx tarsalis  2574         13  CO2
    #> 67 AGENCY 2017     17 County 1 Cx pipiens, Cx tarsalis  4535         22  CO2
    #> 68 AGENCY 2017     18 County 1 Cx pipiens, Cx tarsalis  2189         15  CO2
    #> 69 AGENCY 2017     19 County 1             Cx tarsalis   283         10  CO2
    #> 70 AGENCY 2017     20 County 1 Cx pipiens, Cx tarsalis    49         22  CO2
    #> 71 AGENCY 2017     21 County 1             Cx tarsalis   138         16  CO2
    #> 72 AGENCY 2016      8 County 1             Cx tarsalis    68         12  CO2
    #> 73 AGENCY 2016      9 County 1 Cx pipiens, Cx tarsalis    13         11  CO2
    #> 74 AGENCY 2016     10 County 1 Cx pipiens, Cx tarsalis   323          9  CO2
    #> 75 AGENCY 2016     11 County 1 Cx pipiens, Cx tarsalis    52         15  CO2
    #> 76 AGENCY 2016     12 County 1 Cx pipiens, Cx tarsalis   559         26  CO2
    #> 77 AGENCY 2016     13 County 1 Cx pipiens, Cx tarsalis  1189         21  CO2
    #> 78 AGENCY 2016     14 County 1 Cx pipiens, Cx tarsalis    94         10  CO2
    #> 79 AGENCY 2016     15 County 1 Cx pipiens, Cx tarsalis  2198         18  CO2
    #> 80 AGENCY 2016     16 County 1 Cx pipiens, Cx tarsalis  1128         10  CO2
    #> 81 AGENCY 2016     17 County 1 Cx pipiens, Cx tarsalis  1107         18  CO2
    #> 82 AGENCY 2016     18 County 1 Cx pipiens, Cx tarsalis   330         16  CO2
    #> 83 AGENCY 2016     19 County 1 Cx pipiens, Cx tarsalis   160         17  CO2
    #> 84 AGENCY 2016     20 County 1 Cx pipiens, Cx tarsalis    38         16  CO2
    #> 85 AGENCY 2016     21 County 1 Cx pipiens, Cx tarsalis     8          9  CO2
    #> 86 AGENCY 2015      8 County 1              Cx pipiens     8          6  CO2
    #> 87 AGENCY 2015      9 County 1 Cx pipiens, Cx tarsalis    12         10  CO2
    #> 88 AGENCY 2015     10 County 1 Cx pipiens, Cx tarsalis   612         27  CO2
    #> 89 AGENCY 2015     11 County 1 Cx pipiens, Cx tarsalis   318         19  CO2
    #> 90 AGENCY 2015     12 County 1 Cx pipiens, Cx tarsalis   737         16  CO2
    #> 91 AGENCY 2015     13 County 1 Cx pipiens, Cx tarsalis   405         17  CO2
    #> 92 AGENCY 2015     14 County 1 Cx pipiens, Cx tarsalis   531         15  CO2
    #> 93 AGENCY 2015     15 County 1 Cx pipiens, Cx tarsalis   780         10  CO2
    #> 94 AGENCY 2015     16 County 1 Cx pipiens, Cx tarsalis   805         18  CO2
    #> 95 AGENCY 2015     17 County 1 Cx pipiens, Cx tarsalis  2433         15  CO2
    #> 96 AGENCY 2015     18 County 1 Cx pipiens, Cx tarsalis  2056         20  CO2
    #> 97 AGENCY 2015     19 County 1 Cx pipiens, Cx tarsalis   164         17  CO2
    #> 98 AGENCY 2015     20 County 1 Cx pipiens, Cx tarsalis   569         22  CO2
    #> 99 AGENCY 2015     21 County 1              Cx pipiens    45          5  CO2
    #>    Abundance
    #> 1       3.33
    #> 2       1.33
    #> 3       2.30
    #> 4       1.80
    #> 5       1.31
    #> 6      47.40
    #> 7      28.17
    #> 8       8.78
    #> 9     313.70
    #> 10    188.75
    #> 11      2.88
    #> 12      8.17
    #> 13      3.50
    #> 14      3.90
    #> 15      2.67
    #> 16     14.00
    #> 17      4.00
    #> 18     13.60
    #> 19     25.10
    #> 20     14.86
    #> 21    215.33
    #> 22      4.75
    #> 23     43.12
    #> 24    167.00
    #> 25     11.29
    #> 26     14.38
    #> 27      3.58
    #> 28      4.69
    #> 29      1.09
    #> 30      1.12
    #> 31      0.75
    #> 32      3.00
    #> 33      2.00
    #> 34      3.14
    #> 35     35.25
    #> 36     12.75
    #> 37     67.77
    #> 38     44.33
    #> 39    264.94
    #> 40      4.86
    #> 41     11.00
    #> 42     43.67
    #> 43      6.00
    #> 44     17.83
    #> 45      4.11
    #> 46     19.00
    #> 47      6.00
    #> 48      5.62
    #> 49    308.92
    #> 50     54.00
    #> 51     13.36
    #> 52    115.07
    #> 53      3.15
    #> 54     16.23
    #> 55     12.50
    #> 56      4.70
    #> 57      1.22
    #> 58      2.50
    #> 59      2.25
    #> 60      9.31
    #> 61     27.00
    #> 62      3.82
    #> 63     11.00
    #> 64     17.83
    #> 65     66.90
    #> 66    198.00
    #> 67    206.14
    #> 68    145.93
    #> 69     28.30
    #> 70      2.23
    #> 71      8.62
    #> 72      5.67
    #> 73      1.18
    #> 74     35.89
    #> 75      3.47
    #> 76     21.50
    #> 77     56.62
    #> 78      9.40
    #> 79    122.11
    #> 80    112.80
    #> 81     61.50
    #> 82     20.62
    #> 83      9.41
    #> 84      2.38
    #> 85      0.89
    #> 86      1.33
    #> 87      1.20
    #> 88     22.67
    #> 89     16.74
    #> 90     46.06
    #> 91     23.82
    #> 92     35.40
    #> 93     78.00
    #> 94     44.72
    #> 95    162.20
    #> 96    102.80
    #> 97      9.65
    #> 98     25.86
    #> 99      9.00

### Abundance Anomaly (comparison to 5 year average)

getAbundanceAnomaly()

Description

`getAbundanceAnomaly(...)` requires at least five years prior to the target_year of mosquito collections data to calculate for the specified parameters. The function uses the methods of the Gateway Abundance Anomaly calculator, and will not work if there is fewer than five years of data present.

Usage

`getAbundanceAnomaly(collections,interval,target_year, species = NULL, trap = NULL, separate_by = NULL)`

Arguments

- collections: Collections data retrieved from `getArthroCollections(...)`
- interval: Calculation interval for abundance, accepts “collection_date”,“Biweek”,“Week”, and “Month.
- target_year: Year to calculate analysis on. Collections data must have a year range of at least (target_year - 5, target_year).
- species: Species filter for calculating abundance. Species_display_name is the accepted notation. To see a list of species present in your data run `unique(collections$species_display_name)`. If species is unspecified, the default `NULL` will return data for all species in data.
- trap: Trap filter for calculating abundance. Trap_acronym is the is the accepted notation. Run `unique(collections$trap_acronym)` to see trap types present in your data. If trap is unspecified, the default `NULL` will return data for all trap types.
- separate_by:Separate/group the calculation by ‘trap’,‘species’ or ‘agency’. Default NULL does not separate calculation

    getAbundanceAnomaly(sample_collections,
                        interval = "Biweek",
                        target_year = 2020,
                        species = c("Cx tarsalis", "Cx pipiens"),
                        trap = "CO2",
                        separate_by  = "species")
    #> Warning in getAbundanceAnomaly(sample_collections, interval = "Biweek", : There
    #> are years greater than the target year in the data. These years will not be
    #> included in the anomaly calculation.
    #>    Agency Year Biweek   County     Species Count TrapEvents Trap Abundance
    #> 1  AGENCY 2020      9 County 1 Cx tarsalis    56          4  CO2     14.00
    #> 2  AGENCY 2020     10 County 1  Cx pipiens     1          6  CO2      0.17
    #> 3  AGENCY 2020     10 County 1 Cx tarsalis    23          6  CO2      3.83
    #> 4  AGENCY 2020     11 County 1  Cx pipiens    24         15  CO2      1.60
    #> 5  AGENCY 2020     11 County 1 Cx tarsalis   180         15  CO2     12.00
    #> 6  AGENCY 2020     12 County 1  Cx pipiens     5         10  CO2      0.50
    #> 7  AGENCY 2020     12 County 1 Cx tarsalis   246         10  CO2     24.60
    #> 8  AGENCY 2020     13 County 1  Cx pipiens    93         14  CO2      6.64
    #> 9  AGENCY 2020     13 County 1 Cx tarsalis   115         14  CO2      8.21
    #> 10 AGENCY 2020     14 County 1  Cx pipiens   287         12  CO2     23.92
    #> 11 AGENCY 2020     14 County 1 Cx tarsalis  2297         12  CO2    191.42
    #> 12 AGENCY 2020     15 County 1  Cx pipiens    29          8  CO2      3.62
    #> 13 AGENCY 2020     15 County 1 Cx tarsalis     9          8  CO2      1.12
    #> 14 AGENCY 2020     16 County 1  Cx pipiens    87          8  CO2     10.88
    #> 15 AGENCY 2020     16 County 1 Cx tarsalis   258          8  CO2     32.25
    #> 16 AGENCY 2020     17 County 1  Cx pipiens    13         10  CO2      1.30
    #> 17 AGENCY 2020     17 County 1 Cx tarsalis  1657         10  CO2    165.70
    #> 18 AGENCY 2020     18 County 1 Cx tarsalis    79          7  CO2     11.29
    #> 19 AGENCY 2020     19 County 1  Cx pipiens    44         13  CO2      3.38
    #> 20 AGENCY 2020     19 County 1 Cx tarsalis   143         13  CO2     11.00
    #> 21 AGENCY 2020     20 County 1 Cx tarsalis    43         12  CO2      3.58
    #> 22 AGENCY 2020     21 County 1  Cx pipiens    31         13  CO2      2.38
    #> 23 AGENCY 2020     21 County 1 Cx tarsalis    30         13  CO2      2.31
    #> 24 AGENCY 2020     22 County 1  Cx pipiens     2         11  CO2      0.18
    #> 25 AGENCY 2020     22 County 1 Cx tarsalis    10         11  CO2      0.91
    #> 26 AGENCY 2020     23 County 1  Cx pipiens     8          8  CO2      1.00
    #> 27 AGENCY 2020     23 County 1 Cx tarsalis     1          8  CO2      0.12
    #> 28 AGENCY 2020     24 County 1  Cx pipiens     3          4  CO2      0.75
    #>    FiveYearAvg           YearsInAverage   Delta
    #> 1       0.7375      2015,2016,2017,2019 1798.31
    #> 2       1.8820 2015,2016,2017,2018,2019  -90.97
    #> 3      16.1200 2015,2016,2017,2018,2019  -76.24
    #> 4       2.3260 2015,2016,2017,2018,2019  -31.21
    #> 5      15.3640 2015,2016,2017,2018,2019  -21.90
    #> 6       5.3240 2015,2016,2017,2018,2019  -90.61
    #> 7      15.7850      2015,2016,2017,2018   55.84
    #> 8       5.8140 2015,2016,2017,2018,2019   14.21
    #> 9      87.8140 2015,2016,2017,2018,2019  -90.65
    #> 10      4.8300 2015,2016,2017,2018,2019  395.24
    #> 11     27.3620 2015,2016,2017,2018,2019  599.58
    #> 12     22.2620 2015,2016,2017,2018,2019  -83.74
    #> 13     86.8040 2015,2016,2017,2018,2019  -98.71
    #> 14     26.9020 2015,2016,2017,2018,2019  -59.56
    #> 15     68.1900 2015,2016,2017,2018,2019  -52.71
    #> 16      8.8460 2015,2016,2017,2018,2019  -85.30
    #> 17     79.9520 2015,2016,2017,2018,2019  107.25
    #> 18     52.4740 2015,2016,2017,2018,2019  -78.48
    #> 19      6.0700      2015,2016,2018,2019  -44.32
    #> 20     10.3925      2015,2016,2017,2019    5.85
    #> 21      3.8240 2015,2016,2017,2018,2019   -6.38
    #> 22      4.5550                2015,2016  -47.75
    #> 23      3.6825      2016,2017,2018,2019  -37.27
    #> 24          NA                     <NA>      NA
    #> 25          NA                     <NA>      NA
    #> 26          NA                     <NA>      NA
    #> 27          NA                     <NA>      NA
    #> 28          NA                     <NA>      NA

### Infection Rate

getInfectionRate()

Description

`getInfectionRate(...)` estimates the arbovirus infection rate based on testing pools of mosquitoes.

Usage

`getInfectionRate(pools,interval, target_year, target_disease,pt_estimate, scale = 1000, species = c(NULL), trap = c(NULL))`

Arguments

- pools: Pools data retrieved from `getPools(...)`
- interval: Calculation interval for abundance, accepts: “Biweek”,“Week”, and “Month.
- target_year: Year to calculate infection rate for. This year must be present in the data.
- target_disease: The disease to calculate infection rate for–i.e. “WNV”. Disease acronyms are the accepted input. To see a list of disease acronyms, run `unique(pools$target_acronym)`.
- pt_estimate: The estimation type for infection rate. Options include: “mle”,“bc-”mle”, “mir”
- scale: Constant to multiply result
- species: Species filter for calculating abundance. Species_display_name is the accepted notation. To see a list of species present in your data run `unique(pools$species_display_name)`. If species is unspecified, the default `NULL` will return data for all species in data.
- trap: Trap filter for calculating abundance. Trap_acronym is the is the accepted notation. Run `unique(pools$trap_acronym)` to see trap types present in your data. If trap is unspecified, the default `NULL` will return data for all trap types.

    getInfectionRate(sample_pools,
                          interval = "Week",
                          target_disease = "WNV",
                          pt_estimate = "mle",
                          scale = 1000,
                          species = c("Cx pipiens", "Cx tarsalis"),
                          trap = c("CO2"),
                          separate_by="species")
    #> # A tibble: 275 × 9
    #> # Groups:   Year, Week [160]
    #>     Year  Week Agency Species     Trap  Disease InfectionRate LowerCI UpperCI
    #>    <dbl> <dbl> <chr>  <chr>       <chr> <chr>           <dbl>   <dbl>   <dbl>
    #>  1  2015    18 AGENCY Cx pipiens  CO2   WNV                 0       0       0
    #>  2  2015    18 AGENCY Cx tarsalis CO2   WNV                 0       0       0
    #>  3  2015    19 AGENCY Cx pipiens  CO2   WNV                 0       0       0
    #>  4  2015    20 AGENCY Cx tarsalis CO2   WNV                 0       0       0
    #>  5  2015    21 AGENCY Cx pipiens  CO2   WNV                 0       0       0
    #>  6  2015    21 AGENCY Cx tarsalis CO2   WNV                 0       0       0
    #>  7  2015    22 AGENCY Cx pipiens  CO2   WNV                 0       0       0
    #>  8  2015    22 AGENCY Cx tarsalis CO2   WNV                 0       0       0
    #>  9  2015    23 AGENCY Cx pipiens  CO2   WNV                 0       0       0
    #> 10  2015    23 AGENCY Cx tarsalis CO2   WNV                 0       0       0
    #> # ℹ 265 more rows

### Vector Index

getVectorIndex()

Description

`getVectorIndex(...)` The vector index is the relative abundance of infected mosquitoes and is a way to quickly estimate the risk of arbovirus transmission in an area. Vector index is the product of the abundance and infection rate for a given time interval: \(Vector Index = Infection Rate * Abundance\)

Usage

`getVectorIndex(collections, pools, interval, , target_disease, pt_estimate,species=NULL, trap = NULL,)`

Arguments - collections: collections data retrieved from `getArthroCollections(...)` - pools: Pools data retrieved from `getPools(...)`

Note: Years from pools and collections data must overlap

- interval: Calculation interval for abundance, accepts “collection_date”,“Biweek”,“Week”, and “Month.

- target_disease: The disease to calculate infection rate. Disease acronyms are the accepted input. To see a list of disease acronyms, run `unique(pools$target_acronym)`.

- pt_estimate: The estimation type for infection rate. Options include: “mle”,“bc-”mle”, “mir”.

- species: Species filter for calculating abundance. Species_display_name is the accepted notation. To see a list of species present in your data run `unique(pools$species_display_name)`. If species is unspecified, the default `NULL` will return data for all species in data.

- trap: Trap filter for calculating abundance. Trap_acronym is the is the accepted notation. Run `unique(pools$trap_acronym)` to see trap types present in your data. If trap is unspecified, the default `NULL` will return data for all trap types.

- separate_by:Separate/group the calculation by ‘trap’,‘species’ or ‘agency’. Default NULL does not separate calculation

    getVectorIndex(sample_collections,
                   sample_pools,
                   interval = "Biweek",
                   target_disease = "WNV",
                   pt_estimate = "bc-mle",

                   separate_by = c("agency","species"))
    #> # A tibble: 1,233 × 13
    #>     Year Biweek Agency Species         Count Trap   TrapEvents Abundance Disease
    #>    <dbl>  <dbl> <chr>  <chr>           <int> <chr>       <int>     <dbl> <chr>
    #>  1  2015      1 AGENCY An freeborni        4 " MMT…        186      0.02 WNV
    #>  2  2015      1 AGENCY Cs incidens         5 " MMT…        186      0.03 WNV
    #>  3  2015      1 AGENCY Cs inornata       125 " MMT…        186      0.67 WNV
    #>  4  2015      1 AGENCY Cx pipiens         41 " MMT…        186      0.22 WNV
    #>  5  2015      1 AGENCY Cx stigmatosoma     2 " MMT…        186      0.01 WNV
    #>  6  2015      1 AGENCY Cx tarsalis         4 " MMT…        186      0.02 WNV
    #>  7  2015      2 AGENCY Cs incidens        10 " MMT…        137      0.07 WNV
    #>  8  2015      2 AGENCY Cs inornata       147 " MMT…        137      1.07 WNV
    #>  9  2015      2 AGENCY Cx pipiens         12 " MMT…        137      0.09 WNV
    #> 10  2015      2 AGENCY Cx stigmatosoma     1 " MMT…        137      0.01 WNV
    #> # ℹ 1,223 more rows
    #> # ℹ 4 more variables: InfectionRate <dbl>, LowerCI <dbl>, UpperCI <dbl>,
    #> #   VectorIndex <dbl>
    sample_collections%>%filter(species_display_name=="Cx tarsalis", trap_acronym=="CO2")
    #> # A tibble: 343 × 17
    #> # Groups:   surv_year [7]
    #>    agency_code collection_id collection_date surv_year species_display_name
    #>    <chr>               <int> <date>              <dbl> <chr>
    #>  1 AGENCY            1392822 2015-04-26           2015 Cx tarsalis
    #>  2 AGENCY            1411490 2015-05-17           2015 Cx tarsalis
    #>  3 AGENCY            1412519 2015-05-22           2015 Cx tarsalis
    #>  4 AGENCY            1415729 2015-05-25           2015 Cx tarsalis
    #>  5 AGENCY            1399581 2015-05-04           2015 Cx tarsalis
    #>  6 AGENCY            1413728 2015-05-22           2015 Cx tarsalis
    #>  7 AGENCY            1408922 2015-05-15           2015 Cx tarsalis
    #>  8 AGENCY            1400736 2015-05-08           2015 Cx tarsalis
    #>  9 AGENCY            1402308 2015-05-11           2015 Cx tarsalis
    #> 10 AGENCY            1412359 2015-05-22           2015 Cx tarsalis
    #> # ℹ 333 more rows
    #> # ℹ 12 more variables: sex_type <chr>, trap_acronym <chr>,
    #> #   trap_problem_bit <lgl>, num_trap <int>, trap_nights <int>, num_count <int>,
    #> #   site_code <dbl>, agency_id <dbl>, county <chr>, collection_longitude <dbl>,
    #> #   collection_latitude <dbl>, spatial_feature <chr>

## Tables

getPoolsComparisionTable()

Description

`getPoolsComparisionTable()` produces a frequency table for positive and negative pools counts by year and species. The more years present in the data, the larger the table.

Usage

`getPoolsComparisionTable(pools,target_disease, species_separate=F)`

Arguments

- pools: Pools data retrieved from `getPools(...)`
- target_disease: The disease to calculate infection rate for–i.e. “WNV”. Disease acronyms are the accepted input. To see a list of disease acronyms, run `unique(pools$target_acronym)`.
- separate_by:Separate/group the calculation by ‘trap’,‘species’ or ‘agency’. Default NULL does not separate calculation

    getPoolsComparisionTable(
      sample_pools,
      interval = "Week",
      target_disease = "WNV"
    )
    #> # A tibble: 169 × 6
    #> # Groups:   Year, Week [169]
    #>     Year  Week Negative Confirmed Total `Percent Positive`
    #>    <dbl> <dbl>    <int>     <int> <int>              <dbl>
    #>  1  2015    18        3         0     3                  0
    #>  2  2015    19        1         0     1                  0
    #>  3  2015    20        3         0     3                  0
    #>  4  2015    21        9         0     9                  0
    #>  5  2015    22        9         0     9                  0
    #>  6  2015    23        5         0     5                  0
    #>  7  2015    24        6         0     6                  0
    #>  8  2015    25        8         0     8                  0
    #>  9  2015    26        5         0     5                  0
    #> 10  2015    27        9         1    10                 10
    #> # ℹ 159 more rows

### Styling Dataframes with ‘kable’

Professional looking tables can be produced using the ‘kable’ and ‘kableExtra’ packages.

    library(kableExtra)
    #>
    #> Attaching package: 'kableExtra'
    #> The following object is masked from 'package:dplyr':
    #>
    #>     group_rows

    AbAnOutput = getAbundance(
      sample_collections,
      interval = "Biweek",

      species = c("Cx tarsalis", "Cx pipiens"),
      trap = "CO2",
      separate_by = "species")

    head(AbAnOutput)
    #>   Agency Year Biweek   County     Species Count TrapEvents Trap Abundance
    #> 1 AGENCY 2021      4 County 1  Cx pipiens    10          3  CO2      3.33
    #> 2 AGENCY 2021      7 County 1  Cx pipiens     4          3  CO2      1.33
    #> 3 AGENCY 2021      8 County 1  Cx pipiens    10         10  CO2      1.00
    #> 4 AGENCY 2021      8 County 1 Cx tarsalis    13         10  CO2      1.30
    #> 5 AGENCY 2021     10 County 1  Cx pipiens     9          5  CO2      1.80
    #> 6 AGENCY 2021     11 County 1  Cx pipiens     5         13  CO2      0.38

    #kable table where column names, font_size, style and much more can be customized

    AbAnOutput %>%
      kbl() %>%
      kable_styling(
        bootstrap_options = "striped",
        font_size = 14,
        latex_options = "scale_down"
      ) %>%
      footnote(general = "Table X: Combined biweekly Abundance Calculation for Cx. tarsalis, pipiens in CO2 traps", general_title = "")

Agency | Year | Biweek | County | Species | Count | TrapEvents | Trap | Abundance
--- | --- | --- | --- | --- | --- | --- | --- | ---
AGENCY | 2021 | 4 | County 1 | Cx pipiens | 10 | 3 | CO2 | 3.33
AGENCY | 2021 | 7 | County 1 | Cx pipiens | 4 | 3 | CO2 | 1.33
AGENCY | 2021 | 8 | County 1 | Cx pipiens | 10 | 10 | CO2 | 1.00
AGENCY | 2021 | 8 | County 1 | Cx tarsalis | 13 | 10 | CO2 | 1.30
AGENCY | 2021 | 10 | County 1 | Cx pipiens | 9 | 5 | CO2 | 1.80
AGENCY | 2021 | 11 | County 1 | Cx pipiens | 5 | 13 | CO2 | 0.38
AGENCY | 2021 | 11 | County 1 | Cx tarsalis | 12 | 13 | CO2 | 0.92
AGENCY | 2021 | 12 | County 1 | Cx pipiens | 45 | 10 | CO2 | 4.50
AGENCY | 2021 | 12 | County 1 | Cx tarsalis | 429 | 10 | CO2 | 42.90
AGENCY | 2021 | 13 | County 1 | Cx pipiens | 338 | 12 | CO2 | 28.17
AGENCY | 2021 | 14 | County 1 | Cx pipiens | 40 | 9 | CO2 | 4.44
AGENCY | 2021 | 14 | County 1 | Cx tarsalis | 39 | 9 | CO2 | 4.33
AGENCY | 2021 | 15 | County 1 | Cx pipiens | 23 | 10 | CO2 | 2.30
AGENCY | 2021 | 15 | County 1 | Cx tarsalis | 3114 | 10 | CO2 | 311.40
AGENCY | 2021 | 16 | County 1 | Cx pipiens | 71 | 12 | CO2 | 5.92
AGENCY | 2021 | 16 | County 1 | Cx tarsalis | 2194 | 12 | CO2 | 182.83
AGENCY | 2021 | 17 | County 1 | Cx pipiens | 18 | 8 | CO2 | 2.25
AGENCY | 2021 | 17 | County 1 | Cx tarsalis | 5 | 8 | CO2 | 0.62
AGENCY | 2021 | 18 | County 1 | Cx tarsalis | 49 | 6 | CO2 | 8.17
AGENCY | 2021 | 19 | County 1 | Cx tarsalis | 35 | 10 | CO2 | 3.50
AGENCY | 2021 | 20 | County 1 | Cx tarsalis | 39 | 10 | CO2 | 3.90
AGENCY | 2021 | 21 | County 1 | Cx pipiens | 1 | 6 | CO2 | 0.17
AGENCY | 2021 | 21 | County 1 | Cx tarsalis | 15 | 6 | CO2 | 2.50
AGENCY | 2020 | 9 | County 1 | Cx tarsalis | 56 | 4 | CO2 | 14.00
AGENCY | 2020 | 10 | County 1 | Cx pipiens | 1 | 6 | CO2 | 0.17
AGENCY | 2020 | 10 | County 1 | Cx tarsalis | 23 | 6 | CO2 | 3.83
AGENCY | 2020 | 11 | County 1 | Cx pipiens | 24 | 15 | CO2 | 1.60
AGENCY | 2020 | 11 | County 1 | Cx tarsalis | 180 | 15 | CO2 | 12.00
AGENCY | 2020 | 12 | County 1 | Cx pipiens | 5 | 10 | CO2 | 0.50
AGENCY | 2020 | 12 | County 1 | Cx tarsalis | 246 | 10 | CO2 | 24.60
AGENCY | 2020 | 13 | County 1 | Cx pipiens | 93 | 14 | CO2 | 6.64
AGENCY | 2020 | 13 | County 1 | Cx tarsalis | 115 | 14 | CO2 | 8.21
AGENCY | 2020 | 14 | County 1 | Cx pipiens | 287 | 12 | CO2 | 23.92
AGENCY | 2020 | 14 | County 1 | Cx tarsalis | 2297 | 12 | CO2 | 191.42
AGENCY | 2020 | 15 | County 1 | Cx pipiens | 29 | 8 | CO2 | 3.62
AGENCY | 2020 | 15 | County 1 | Cx tarsalis | 9 | 8 | CO2 | 1.12
AGENCY | 2020 | 16 | County 1 | Cx pipiens | 87 | 8 | CO2 | 10.88
AGENCY | 2020 | 16 | County 1 | Cx tarsalis | 258 | 8 | CO2 | 32.25
AGENCY | 2020 | 17 | County 1 | Cx pipiens | 13 | 10 | CO2 | 1.30
AGENCY | 2020 | 17 | County 1 | Cx tarsalis | 1657 | 10 | CO2 | 165.70
AGENCY | 2020 | 18 | County 1 | Cx tarsalis | 79 | 7 | CO2 | 11.29
AGENCY | 2020 | 19 | County 1 | Cx pipiens | 44 | 13 | CO2 | 3.38
AGENCY | 2020 | 19 | County 1 | Cx tarsalis | 143 | 13 | CO2 | 11.00
AGENCY | 2020 | 20 | County 1 | Cx tarsalis | 43 | 12 | CO2 | 3.58
AGENCY | 2020 | 21 | County 1 | Cx pipiens | 31 | 13 | CO2 | 2.38
AGENCY | 2020 | 21 | County 1 | Cx tarsalis | 30 | 13 | CO2 | 2.31
AGENCY | 2020 | 22 | County 1 | Cx pipiens | 2 | 11 | CO2 | 0.18
AGENCY | 2020 | 22 | County 1 | Cx tarsalis | 10 | 11 | CO2 | 0.91
AGENCY | 2020 | 23 | County 1 | Cx pipiens | 8 | 8 | CO2 | 1.00
AGENCY | 2020 | 23 | County 1 | Cx tarsalis | 1 | 8 | CO2 | 0.12
AGENCY | 2020 | 24 | County 1 | Cx pipiens | 3 | 4 | CO2 | 0.75
AGENCY | 2019 | 4 | County 1 | Cx pipiens | 3 | 1 | CO2 | 3.00
AGENCY | 2019 | 9 | County 1 | Cx pipiens | 15 | 9 | CO2 | 1.67
AGENCY | 2019 | 9 | County 1 | Cx tarsalis | 3 | 9 | CO2 | 0.33
AGENCY | 2019 | 10 | County 1 | Cx pipiens | 8 | 7 | CO2 | 1.14
AGENCY | 2019 | 10 | County 1 | Cx tarsalis | 14 | 7 | CO2 | 2.00
AGENCY | 2019 | 11 | County 1 | Cx pipiens | 25 | 16 | CO2 | 1.56
AGENCY | 2019 | 11 | County 1 | Cx tarsalis | 539 | 16 | CO2 | 33.69
AGENCY | 2019 | 12 | County 1 | Cx pipiens | 51 | 4 | CO2 | 12.75
AGENCY | 2019 | 13 | County 1 | Cx pipiens | 36 | 13 | CO2 | 2.77
AGENCY | 2019 | 13 | County 1 | Cx tarsalis | 845 | 13 | CO2 | 65.00
AGENCY | 2019 | 14 | County 1 | Cx pipiens | 14 | 6 | CO2 | 2.33
AGENCY | 2019 | 14 | County 1 | Cx tarsalis | 252 | 6 | CO2 | 42.00
AGENCY | 2019 | 15 | County 1 | Cx pipiens | 160 | 16 | CO2 | 10.00
AGENCY | 2019 | 15 | County 1 | Cx tarsalis | 4079 | 16 | CO2 | 254.94
AGENCY | 2019 | 16 | County 1 | Cx pipiens | 14 | 14 | CO2 | 1.00
AGENCY | 2019 | 16 | County 1 | Cx tarsalis | 54 | 14 | CO2 | 3.86
AGENCY | 2019 | 17 | County 1 | Cx pipiens | 3 | 7 | CO2 | 0.43
AGENCY | 2019 | 17 | County 1 | Cx tarsalis | 74 | 7 | CO2 | 10.57
AGENCY | 2019 | 18 | County 1 | Cx pipiens | 175 | 6 | CO2 | 29.17
AGENCY | 2019 | 18 | County 1 | Cx tarsalis | 87 | 6 | CO2 | 14.50
AGENCY | 2019 | 19 | County 1 | Cx pipiens | 42 | 9 | CO2 | 4.67
AGENCY | 2019 | 19 | County 1 | Cx tarsalis | 12 | 9 | CO2 | 1.33
AGENCY | 2019 | 20 | County 1 | Cx pipiens | 134 | 12 | CO2 | 11.17
AGENCY | 2019 | 20 | County 1 | Cx tarsalis | 80 | 12 | CO2 | 6.67
AGENCY | 2019 | 21 | County 1 | Cx tarsalis | 37 | 9 | CO2 | 4.11
AGENCY | 2018 | 10 | County 1 | Cx pipiens | 8 | 16 | CO2 | 0.50
AGENCY | 2018 | 10 | County 1 | Cx tarsalis | 296 | 16 | CO2 | 18.50
AGENCY | 2018 | 11 | County 1 | Cx pipiens | 80 | 16 | CO2 | 5.00
AGENCY | 2018 | 11 | County 1 | Cx tarsalis | 16 | 16 | CO2 | 1.00
AGENCY | 2018 | 12 | County 1 | Cx pipiens | 27 | 16 | CO2 | 1.69
AGENCY | 2018 | 12 | County 1 | Cx tarsalis | 63 | 16 | CO2 | 3.94
AGENCY | 2018 | 13 | County 1 | Cx pipiens | 132 | 13 | CO2 | 10.15
AGENCY | 2018 | 13 | County 1 | Cx tarsalis | 3884 | 13 | CO2 | 298.77
AGENCY | 2018 | 14 | County 1 | Cx pipiens | 34 | 9 | CO2 | 3.78
AGENCY | 2018 | 14 | County 1 | Cx tarsalis | 452 | 9 | CO2 | 50.22
AGENCY | 2018 | 15 | County 1 | Cx pipiens | 105 | 11 | CO2 | 9.55
AGENCY | 2018 | 15 | County 1 | Cx tarsalis | 42 | 11 | CO2 | 3.82
AGENCY | 2018 | 16 | County 1 | Cx pipiens | 782 | 14 | CO2 | 55.86
AGENCY | 2018 | 16 | County 1 | Cx tarsalis | 829 | 14 | CO2 | 59.21
AGENCY | 2018 | 17 | County 1 | Cx pipiens | 6 | 13 | CO2 | 0.46
AGENCY | 2018 | 17 | County 1 | Cx tarsalis | 35 | 13 | CO2 | 2.69
AGENCY | 2018 | 18 | County 1 | Cx pipiens | 200 | 13 | CO2 | 15.38
AGENCY | 2018 | 18 | County 1 | Cx tarsalis | 11 | 13 | CO2 | 0.85
AGENCY | 2018 | 19 | County 1 | Cx pipiens | 125 | 10 | CO2 | 12.50
AGENCY | 2018 | 20 | County 1 | Cx pipiens | 31 | 10 | CO2 | 3.10
AGENCY | 2018 | 20 | County 1 | Cx tarsalis | 16 | 10 | CO2 | 1.60
AGENCY | 2018 | 21 | County 1 | Cx tarsalis | 11 | 9 | CO2 | 1.22
AGENCY | 2017 | 8 | County 1 | Cx pipiens | 10 | 4 | CO2 | 2.50
AGENCY | 2017 | 9 | County 1 | Cx pipiens | 11 | 8 | CO2 | 1.38
AGENCY | 2017 | 9 | County 1 | Cx tarsalis | 7 | 8 | CO2 | 0.88
AGENCY | 2017 | 10 | County 1 | Cx pipiens | 11 | 16 | CO2 | 0.69
AGENCY | 2017 | 10 | County 1 | Cx tarsalis | 138 | 16 | CO2 | 8.62
AGENCY | 2017 | 11 | County 1 | Cx pipiens | 33 | 13 | CO2 | 2.54
AGENCY | 2017 | 11 | County 1 | Cx tarsalis | 318 | 13 | CO2 | 24.46
AGENCY | 2017 | 12 | County 1 | Cx pipiens | 43 | 17 | CO2 | 2.53
AGENCY | 2017 | 12 | County 1 | Cx tarsalis | 22 | 17 | CO2 | 1.29
AGENCY | 2017 | 13 | County 1 | Cx pipiens | 135 | 19 | CO2 | 7.11
AGENCY | 2017 | 13 | County 1 | Cx tarsalis | 74 | 19 | CO2 | 3.89
AGENCY | 2017 | 14 | County 1 | Cx pipiens | 86 | 23 | CO2 | 3.74
AGENCY | 2017 | 14 | County 1 | Cx tarsalis | 324 | 23 | CO2 | 14.09
AGENCY | 2017 | 15 | County 1 | Cx pipiens | 230 | 10 | CO2 | 23.00
AGENCY | 2017 | 15 | County 1 | Cx tarsalis | 439 | 10 | CO2 | 43.90
AGENCY | 2017 | 16 | County 1 | Cx pipiens | 295 | 13 | CO2 | 22.69
AGENCY | 2017 | 16 | County 1 | Cx tarsalis | 2279 | 13 | CO2 | 175.31
AGENCY | 2017 | 17 | County 1 | Cx pipiens | 286 | 22 | CO2 | 13.00
AGENCY | 2017 | 17 | County 1 | Cx tarsalis | 4249 | 22 | CO2 | 193.14
AGENCY | 2017 | 18 | County 1 | Cx pipiens | 46 | 15 | CO2 | 3.07
AGENCY | 2017 | 18 | County 1 | Cx tarsalis | 2143 | 15 | CO2 | 142.87
AGENCY | 2017 | 19 | County 1 | Cx tarsalis | 283 | 10 | CO2 | 28.30
AGENCY | 2017 | 20 | County 1 | Cx pipiens | 42 | 22 | CO2 | 1.91
AGENCY | 2017 | 20 | County 1 | Cx tarsalis | 7 | 22 | CO2 | 0.32
AGENCY | 2017 | 21 | County 1 | Cx tarsalis | 138 | 16 | CO2 | 8.62
AGENCY | 2016 | 8 | County 1 | Cx tarsalis | 68 | 12 | CO2 | 5.67
AGENCY | 2016 | 9 | County 1 | Cx pipiens | 6 | 11 | CO2 | 0.55
AGENCY | 2016 | 9 | County 1 | Cx tarsalis | 7 | 11 | CO2 | 0.64
AGENCY | 2016 | 10 | County 1 | Cx pipiens | 59 | 9 | CO2 | 6.56
AGENCY | 2016 | 10 | County 1 | Cx tarsalis | 264 | 9 | CO2 | 29.33
AGENCY | 2016 | 11 | County 1 | Cx pipiens | 8 | 15 | CO2 | 0.53
AGENCY | 2016 | 11 | County 1 | Cx tarsalis | 44 | 15 | CO2 | 2.93
AGENCY | 2016 | 12 | County 1 | Cx pipiens | 17 | 26 | CO2 | 0.65
AGENCY | 2016 | 12 | County 1 | Cx tarsalis | 542 | 26 | CO2 | 20.85
AGENCY | 2016 | 13 | County 1 | Cx pipiens | 91 | 21 | CO2 | 4.33
AGENCY | 2016 | 13 | County 1 | Cx tarsalis | 1098 | 21 | CO2 | 52.29
AGENCY | 2016 | 14 | County 1 | Cx pipiens | 7 | 10 | CO2 | 0.70
AGENCY | 2016 | 14 | County 1 | Cx tarsalis | 87 | 10 | CO2 | 8.70
AGENCY | 2016 | 15 | County 1 | Cx pipiens | 208 | 18 | CO2 | 11.56
AGENCY | 2016 | 15 | County 1 | Cx tarsalis | 1990 | 18 | CO2 | 110.56
AGENCY | 2016 | 16 | County 1 | Cx pipiens | 454 | 10 | CO2 | 45.40
AGENCY | 2016 | 16 | County 1 | Cx tarsalis | 674 | 10 | CO2 | 67.40
AGENCY | 2016 | 17 | County 1 | Cx pipiens | 395 | 18 | CO2 | 21.94
AGENCY | 2016 | 17 | County 1 | Cx tarsalis | 712 | 18 | CO2 | 39.56
AGENCY | 2016 | 18 | County 1 | Cx pipiens | 78 | 16 | CO2 | 4.88
AGENCY | 2016 | 18 | County 1 | Cx tarsalis | 252 | 16 | CO2 | 15.75
AGENCY | 2016 | 19 | County 1 | Cx pipiens | 23 | 17 | CO2 | 1.35
AGENCY | 2016 | 19 | County 1 | Cx tarsalis | 137 | 17 | CO2 | 8.06
AGENCY | 2016 | 20 | County 1 | Cx pipiens | 28 | 16 | CO2 | 1.75
AGENCY | 2016 | 20 | County 1 | Cx tarsalis | 10 | 16 | CO2 | 0.62
AGENCY | 2016 | 21 | County 1 | Cx pipiens | 1 | 9 | CO2 | 0.11
AGENCY | 2016 | 21 | County 1 | Cx tarsalis | 7 | 9 | CO2 | 0.78
AGENCY | 2015 | 8 | County 1 | Cx pipiens | 8 | 6 | CO2 | 1.33
AGENCY | 2015 | 9 | County 1 | Cx pipiens | 1 | 10 | CO2 | 0.10
AGENCY | 2015 | 9 | County 1 | Cx tarsalis | 11 | 10 | CO2 | 1.10
AGENCY | 2015 | 10 | County 1 | Cx pipiens | 14 | 27 | CO2 | 0.52
AGENCY | 2015 | 10 | County 1 | Cx tarsalis | 598 | 27 | CO2 | 22.15
AGENCY | 2015 | 11 | County 1 | Cx pipiens | 38 | 19 | CO2 | 2.00
AGENCY | 2015 | 11 | County 1 | Cx tarsalis | 280 | 19 | CO2 | 14.74
AGENCY | 2015 | 12 | County 1 | Cx pipiens | 144 | 16 | CO2 | 9.00
AGENCY | 2015 | 12 | County 1 | Cx tarsalis | 593 | 16 | CO2 | 37.06
AGENCY | 2015 | 13 | County 1 | Cx pipiens | 80 | 17 | CO2 | 4.71
AGENCY | 2015 | 13 | County 1 | Cx tarsalis | 325 | 17 | CO2 | 19.12
AGENCY | 2015 | 14 | County 1 | Cx pipiens | 204 | 15 | CO2 | 13.60
AGENCY | 2015 | 14 | County 1 | Cx tarsalis | 327 | 15 | CO2 | 21.80
AGENCY | 2015 | 15 | County 1 | Cx pipiens | 572 | 10 | CO2 | 57.20
AGENCY | 2015 | 15 | County 1 | Cx tarsalis | 208 | 10 | CO2 | 20.80
AGENCY | 2015 | 16 | County 1 | Cx pipiens | 172 | 18 | CO2 | 9.56
AGENCY | 2015 | 16 | County 1 | Cx tarsalis | 633 | 18 | CO2 | 35.17
AGENCY | 2015 | 17 | County 1 | Cx pipiens | 126 | 15 | CO2 | 8.40
AGENCY | 2015 | 17 | County 1 | Cx tarsalis | 2307 | 15 | CO2 | 153.80
AGENCY | 2015 | 18 | County 1 | Cx pipiens | 288 | 20 | CO2 | 14.40
AGENCY | 2015 | 18 | County 1 | Cx tarsalis | 1768 | 20 | CO2 | 88.40
AGENCY | 2015 | 19 | County 1 | Cx pipiens | 98 | 17 | CO2 | 5.76
AGENCY | 2015 | 19 | County 1 | Cx tarsalis | 66 | 17 | CO2 | 3.88
AGENCY | 2015 | 20 | County 1 | Cx pipiens | 351 | 22 | CO2 | 15.95
AGENCY | 2015 | 20 | County 1 | Cx tarsalis | 218 | 22 | CO2 | 9.91
AGENCY | 2015 | 21 | County 1 | Cx pipiens | 45 | 5 | CO2 | 9.00
Table X: Combined biweekly Abundance Calculation for Cx. tarsalis, pipiens in CO2 traps

### Data using ‘datatables’

Interactive html only tables can be produced using the ‘DT’ package. ‘DT’ tables allow for sorting and filtering with in a webpage. These are ideal for viewing data but are not compatible with pdf or word formats.

    library(DT)

    AbAnOutput %>%
      datatable(colnames =  c("Disease Year", "Biweek", "Count", "Species","Trap Type","Trap Events", "Abundance"))

    table(vectorsurvR:::testing_collections$trap_acronym, vectorsurvR:::testing_collections$surv_year) %>%
      kbl(align = "c") %>%
      kable_paper(
        full_width = F,
        html_font = "arial",
        lightable_options = "striped",
      ) %>%
      add_header_above(c("Trap Type", "Years" = 6)) %>%
      footnote(general = "Table 3: Traps deployed by year", general_title = "") %>%
      row_spec(c(3, 9, 10), background = "yellow") %>%
      column_spec(c(4), background = "orange")

Trap Type | Years
--- | ---
| 2019 | 2020 | 2021 | 2022 | 2023 | 2024
BACKPACK | 0 | 0 | 26 | 33 | 11 | 5
BGSENT | 2318 | 90 | 11158 | 14163 | 13535 | 18943
BTLJC | 30 | 33 | 63 | 0 | 0 | 0
CDCAGO | 20 | 0 | 0 | 0 | 0 | 0
CO2 | 12201 | 11622 | 10901 | 9719 | 12364 | 13475
FLANNEL | 3 | 3 | 9 | 14 | 11 | 6
GRVD | 9560 | 10184 | 9221 | 8611 | 9069 | 8910
LCKR | 1434 | 3119 | 3707 | 3693 | 3559 | 3831
NJLT | 3062 | 844 | 0 | 0 | 0 | 0
OTHER | 0 | 0 | 10 | 11 | 37 | 517
OVI | 4 | 0 | 0 | 294 | 0 | 0
WRKR | 0 | 0 | 77 | 0 | 0 | 0
Table 3: Traps deployed by year