| Title: | Analyzing Human Exposure to Mosquito Biting |
| Version: | 0.1.3 |
| Description: | Tools to analyse human and mosquito behavioral interactions and to compute exposure to mosquito bites estimates. Using behavioral data for human individuals and biting patterns for mosquitoes, you will be able to compute hourly exposure for bed net users and non-users, and summarize (e.g. proportion indoors and outdoors, proportion per time periods, and proportion prevented by bed nets) or visualize these dynamics across a 24-hour cycle. |
| License: | GPL-3 |
| Encoding: | UTF-8 |
| RoxygenNote: | 7.3.3 |
| Imports: | dplyr, tidyr, ggplot2, Rdpack (≥ 0.7) |
| RdMacros: | Rdpack |
| Suggests: | knitr, rmarkdown, testthat (≥ 3.0.0) |
| Depends: | R (≥ 4.1.0) |
| Config/testthat/edition: | 3 |
| URL: | https://github.com/Nmoiroux/ExpBites |
| BugReports: | https://github.com/Nmoiroux/ExpBites/issues |
| NeedsCompilation: | no |
| Packaged: | 2025-11-26 10:14:56 UTC; nicolasmoiroux |
| Author: | Nicolas Moiroux |
| Maintainer: | Nicolas Moiroux <nicolas.moiroux@ird.fr> |
| Repository: | CRAN |
| Date/Publication: | 2025-12-01 15:00:08 UTC |
ExpBites: Analyzing Human Exposure to Mosquito Biting
Description
Tools to analyse human and mosquito behavioral interactions and to compute exposure to mosquito bites estimates. Using behavioral data for human individuals and biting patterns for mosquitoes, you will be able to compute hourly exposure for bed net users and non-users, and summarize (e.g. proportion indoors and outdoors, proportion per time periods, and proportion prevented by bed nets) or visualize these dynamics across a 24-hour cycle.
Author(s)
Maintainer: Nicolas Moiroux nicolas.moiroux@ird.fr (ORCID)
See Also
Useful links:
Calculate Hourly Mosquito Biting Exposure for Bednet Users and Non-Users
Description
Using a model of behavioral interactions, computes the hourly exposure to mosquito bites for both bednet users and non-users, based on their location (indoors, outdoors, under a net) and mosquito biting rates. For users, exposure is adjusted for the protective effect of bednets.
Usage
calculate_Exp(df, df_bites, protection = 0.92)
Arguments
df |
A dataframe with individual-level data, including columns:
|
df_bites |
A dataframe of biting rates by hour, with columns:
|
protection |
A numeric value (default = 0.92, according to Corbel et al. (2010) for Permanet 2 ITNs) indicating the proportion of bites prevented by bednet use. |
Details
The mathematical model of behavioral interactions is an extension of the Killeen et al. (2006) model as previously described in Geissbühler et al. (2007) and Moiroux et al. (2014)
Value
A dataframe with one row per hour (0–23) and the following columns:
-
Bi_t– indoor biting rate, -
Bo_t– outdoor biting rate, -
N– number of human individuals, -
Np– number of human individuals that are net users, -
It– proportion of people indoors (users and non-users), -
Eui– mean exposure of non-users indoors, -
Euo– mean exposure of non-users outdoors, -
Eu– total mean exposure of non-users, -
p_in– proportion of people (users) being indoors, -
p_net– proportion of people (users) being asleep (under net), -
Epi– mean exposure of users indoors (not under net), -
Epn– mean exposure of users indoors under bed net (adjusted by protection), -
Epo– mean exposure of users outdoors, -
Epp– mean exposure prevented by bed net use, -
Ep– total mean exposure of users.
References
Corbel V, Chabi J, Dabiré RK, Etang J, Nwane P, Pigeon O, Akogbeto M, Hougard J (2010).
“Field Efficacy of a New Mosaic Long-Lasting Mosquito Net (PermaNet 3.0) against Pyrethroid-Resistant Malaria Vectors: A Multi Centre Study in Western and Central Africa.”
Malaria Journal, 9, 113.
ISSN 1475-2875, doi:10.1186/1475-2875-9-113.
Geissbühler Y, Chaki P, Emidi B, Govella NJ, Shirima R, Mayagaya V, Mtasiwa D, Mshinda H, Fillinger U, Lindsay SW, Kannady K, de Castro MC, Tanner M, Killeen GF (2007).
“Interdependence of Domestic Malaria Prevention Measures and Mosquito-Human Interactions in Urban Dar Es Salaam, Tanzania.”
Malaria Journal, 6, 126.
ISSN 1475-2875, doi:10.1186/1475-2875-6-126.
Killeen GF, Kihonda J, Lyimo E, Oketch FR, Kotas ME, Mathenge E, Schellenberg JA, Lengeler C, Smith TA, Drakeley CJ (2006).
“Quantifying Behavioural Interactions between Humans and Mosquitoes: Evaluating the Protective Efficacy of Insecticidal Nets against Malaria Transmission in Rural Tanzania.”
BMC infectious diseases, 6, 161.
ISSN 1471-2334, doi:10.1186/1471-2334-6-161.
Moiroux N, Damien GB, Egrot M, Djenontin A, Chandre F, Corbel V, Killeen GF, Pennetier C (2014).
“Human Exposure to Early Morning Anopheles Funestus Biting Behavior and Personal Protection Provided by Long-Lasting Insecticidal Nets.”
PloS One, 9(8), e104967.
ISSN 1932-6203, doi:10.1371/journal.pone.0104967.
Examples
# generate fake data
df <- gen_df_human(n_individuals = 100, hours = c(0:9,17:23))
df_bites <- gen_df_mosquito()
# calculate mean hourly exposure to bites
exposure_results <- calculate_Exp(df, df_bites)
Generate a Simulated Dataset of Human Behavioral States Over 24 Hours
Description
Simulates the hourly state of a set of individuals (either bednet users or non-users) over a 24-hour period. Each individual's state is assigned probabilistically based on the hour of the day and whether they use a bednet.
Usage
gen_df_human(n_individuals = 100, hours = c(0:23), prob_use = 0.5)
Arguments
n_individuals |
Integer. Number of individuals to simulate. Default is 100. |
hours |
Integer vector. The hours of the day to simulate, typically |
prob_use |
Numeric. Probability of being a bednet user vs non-user. Default is 0.5. |
Value
A data.frame with the following columns:
- individual
Individual ID.
- hour
Hour of the day (0–23).
- bednet_user
Logical, indicating whether the individual is a bednet user.
- state
Integer representing the individual’s state at that hour:
1= outdoors,2= indoors and awake,3= indoors asleep (non-user),4= indoors asleep under bednet (user).- state_label
Factor version of
statewith descriptive labels.
Examples
df <- gen_df_human(n_individuals = 50)
df <- gen_df_human(n_individuals = 100, hours = c(0:9,17:23))
head(df)
Generate a Simulated Dataset of Hourly Mosquito Biting Rates
Description
Simulates the number of Anopheles mosquito bites occurring indoors and outdoors for each hour of the day. Biting rates follow predefined lambda patterns that reflect typical mosquito activity (e.g., low during the day, peaking at night).
Usage
gen_df_mosquito()
Value
A data.frame with the following columns:
- hour
Hour of the day (0–23).
- indoor_bites
Simulated number of mosquito bites occurring indoors for each hour.
- outdoor_bites
Simulated number of mosquito bites occurring outdoors for each hour.
Examples
df_bites <- gen_df_mosquito()
head(df_bites)
Plot Human and Mosquito Behaviors by Hour
Description
Generates a dual-axis plot showing the hourly variation in human behavior (proportion of individuals indoors and under bednets) and mosquito biting behavior (biting rates indoors and outdoors). Human behavior is shown as a stacked area plot on the primary Y-axis, while mosquito biting rates are shown as lines on the secondary Y-axis. Hours are centered on midnight.
Usage
plot_behaviors(data)
Arguments
data |
A dataframe (typically the output of
|
Value
A ggplot2 plot object with a stacked area chart for human behavior (on the primary Y-axis)
and line plots for mosquito biting rates (on the secondary Y-axis), with hours centered on midnight.
Examples
# generate fake data
df <- gen_df_human(n_individuals = 100, hours = c(0:9,17:23))
df_bites <- gen_df_mosquito()
# calculate mean hourly exposure to bites
exposure_results <- calculate_Exp(df, df_bites)
# plot
plot_behaviors(exposure_results)
Plot Exposure to Mosquito Bites by Hour for Bednet Users
Description
Creates a stacked area chart showing the hourly distribution of exposure to mosquito bites among bednet users, broken down by exposure type: outdoors, indoors (no net), indoors (under net), and prevented exposure due to bednet use. The hours are centered on midnight for better visualization.
Usage
plot_exposure(data, cPalette = c("#000000", "#E69F00", "#56B4E9", "#009E73"))
Arguments
data |
A dataframe resulting from the
|
cPalette |
A character vector of color values (hex codes or color names) used to fill each exposure category.
Must be of length 4 and will be applied in the following order:
|
Value
A ggplot2 stacked area chart object showing the distribution of exposure types across centered hours.
Examples
# generate fake data
df <- gen_df_human(n_individuals = 100, hours = c(0:9,17:23))
df_bites <- gen_df_mosquito()
# calculate mean hourly exposure to bites
exposure_results <- calculate_Exp(df, df_bites)
# plot
plot_exposure(exposure_results)
Summarize Exposure to Mosquito Bites Over 24h and a Time Interval
Description
Computes daily (24h) and interval-specific exposure statistics for both non-users and bednet users,
based on the output of calculate_Exp. Protective efficacy of bednets
and proportion of exposure indoors or during the specified interval are computed.
Usage
summarise_exposure(data, interval = c(22, 5))
Arguments
data |
A dataframe returned by
|
interval |
A numeric vector of length 2 giving the start and end hour (inclusive) of the time interval,
e.g., |
Details
The mathematical model of behavioral interactions is an extension of the Killeen et al. (2006) model as previously described in Geissbühler et al. (2007) and Moiroux et al. (2014)
Value
A tibble with three columns:
- type
Character string indicating the category of summary:
"non_user_daily","user_daily","non_user_interval","user_interval","interval_vs_daily"or"net_efficacy".- output
Name of the exposure component or metric (e.g.,
"Eui","Euo","Ep","Epp","prop_indoor", etc.,"prop_interval_non_user","prop_interval_user"and"prop_prevented").- value
Numeric value corresponding to the output for the given type.
References
Geissbühler Y, Chaki P, Emidi B, Govella NJ, Shirima R, Mayagaya V, Mtasiwa D, Mshinda H, Fillinger U, Lindsay SW, Kannady K, de Castro MC, Tanner M, Killeen GF (2007).
“Interdependence of Domestic Malaria Prevention Measures and Mosquito-Human Interactions in Urban Dar Es Salaam, Tanzania.”
Malaria Journal, 6, 126.
ISSN 1475-2875, doi:10.1186/1475-2875-6-126.
Killeen GF, Kihonda J, Lyimo E, Oketch FR, Kotas ME, Mathenge E, Schellenberg JA, Lengeler C, Smith TA, Drakeley CJ (2006).
“Quantifying Behavioural Interactions between Humans and Mosquitoes: Evaluating the Protective Efficacy of Insecticidal Nets against Malaria Transmission in Rural Tanzania.”
BMC infectious diseases, 6, 161.
ISSN 1471-2334, doi:10.1186/1471-2334-6-161.
Moiroux N, Damien GB, Egrot M, Djenontin A, Chandre F, Corbel V, Killeen GF, Pennetier C (2014).
“Human Exposure to Early Morning Anopheles Funestus Biting Behavior and Personal Protection Provided by Long-Lasting Insecticidal Nets.”
PloS One, 9(8), e104967.
ISSN 1932-6203, doi:10.1371/journal.pone.0104967.
Examples
# generate fake data
df <- gen_df_human(n_individuals = 100, hours = c(0:9,17:23))
df_bites <- gen_df_mosquito()
# calculate mean hourly exposure to bites
exposure_results <- calculate_Exp(df, df_bites)
# summarise exposure estimates
summarise_exposure(exposure_results, interval = c(22, 5))