Skip to content

reply98/geotrace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

geotrace

The goal of geotrace is to provide statistical methods and tools for spatial data analysis, focusing on tracing the sources of infectious diseases. The package includes functions for performing significance tests based on distances between points, as well as for visualizing the results through various aggregation methods (e.g., mean, median).

Installation

You can install the development version of geotrace like so:

# Install devtools if you don't have it already
install.packages("devtools")

# Install the development version of geotrace
devtools::install_github("reply98/geotrace")

Example

This is a basic example which shows you how to use geotrace to perform a significance test based on distances between origins and cases:

library(geotrace)

# Load example data
data("Cholera_1854_London")  # Replace with the correct dataset name
# Transform pump locations to match the CRS of the death data
pumps <- st_transform(pumps, crs = st_crs(house_death))
# Filter case data to include only locations where death occurred
case <- house_death[house_death$death_dum == 1,]
# Define names for the origin points (pumps)
orig_names <- c("Broad St", "Great Mal.", "Ramilies Place", "Rupert St", "Brewer St", "Warwick St")

# Perform significance test for median aggregation
result <- sig_origin(case = case, origins = pumps, pop = house_death, nsim = 999, agg = "median", orig_names = orig_names)

print(result)

# Plot the results
plot(result)

In this example:

  • house_death represents the case data with death occurrences.
  • pumps represents the origin points, which are locations of interest (e.g., water pumps).
  • sig_origin() performs a statistical significance test for distances between the cases and the origins using 999 simulations and median aggregation.
  • The result is printed and visualized with a plot.

Functions

  • sig_origin(): Performs statistical significance tests on the distance distributions between case locations and origin points.
  • plot.sig_origin(): Visualizes the results of the significance tests using histograms of the distance distributions.
  • print.sig_origin(): Print the Summary of the Significance Test for Origin Locations

Documentation

For more information on how to use geotrace and its functions, please refer to the package documentation or vignettes. You can view vignettes as follows:

# To view vignettes
vignette('case1_cholera')
vignette("case2_SARS-CoV-2")

Contributing

Please feel free to submit issues or pull requests to help improve geotrace.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

About

No description, website, or topics provided.

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published