catchment_sim {ATQ} | R Documentation |

## Simulating catchment areas

### Description

Function to simulate specified catchments of square area (a x a). The number of schools in each catchment area is simulated via a specified distribution function, with gamma distribution as the default.

### Usage

```
catchment_sim(n, area, dist_func = stats::rgamma, ...)
```

### Arguments

`n` |
number of catchments to be simulated |

`area` |
square dimension for catchment (if area = 20, then each catchment dimensions will be 20 x 20) |

`dist_func` |
distribution function to simulate number of schools, default is stats::rgamma |

`...` |
additional arguments passed to the distribution function |

### Value

A data frame with n rows and the following columns:

`catchID` |
Unique identifier for each catchment area |

`num.schools` |
Number of schools in the catchment area |

`xStart` |
Starting x-coordinate of the catchment area |

`xEnd` |
Ending x-coordinate of the catchment area |

`yStart` |
Starting y-coordinate of the catchment area |

`yEnd` |
Ending y-coordinate of the catchment area |

### Examples

```
# Using default gamma distribution
catch_df1 <- catchment_sim(16, 20, shape = 4.1, rate = 2.7)
# Using normal distribution
catch_df2 <- catchment_sim(16, 20, dist_func = stats::rnorm, mean = 5, sd = 1)
# Using Poisson distribution
catch_df3 <- catchment_sim(16, 20, dist_func = stats::rpois, lambda = 3)
```

*ATQ*version 0.2.2 Index]