elementary_pop {ATQ} | R Documentation |

## Create Elementary Schools population size

### Description

Function to simulate elementary school size and assigns it to catchments. The school population is simulated using a specified distribution function, with gamma distribution as the default.

### Usage

```
elementary_pop(df, dist_func = stats::rgamma, ...)
```

### Arguments

`df` |
output data frame from catchment_sim function |

`dist_func` |
distribution function to simulate school population, default is stats::rgamma |

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

### Value

A data frame with the following columns:

`catchID` |
Identifier for the catchment area |

`schoolID` |
Unique identifier for each school |

`schoolPop` |
Simulated population of the school |

`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

```
# Simulate catchment areas
catch_df <- catchment_sim(16, 20, shape = 3.5, rate = 2.8)
# Simulate elementary schools using default gamma distribution
elementary_df1 <- elementary_pop(catch_df, shape = 5.1, rate = 0.015)
# Simulate elementary schools using normal distribution
elementary_df2 <- elementary_pop(catch_df, dist_func = stats::rnorm,
mean = 300, sd = 50)
# Simulate elementary schools using Poisson distribution
elementary_df3 <- elementary_pop(catch_df, dist_func = stats::rpois,
lambda = 250)
```

[Package

*ATQ*version 0.2.2 Index]