as.disag_data {disaggregation} | R Documentation |

## Function to fit the disaggregation model

### Description

Function to fit the disaggregation model

### Usage

```
as.disag_data(
polygon_shapefile,
shapefile_names,
covariate_rasters,
polygon_data,
covariate_data,
aggregation_pixels,
coordsForFit,
coordsForPrediction,
startendindex,
mesh = NULL
)
```

### Arguments

`polygon_shapefile` |
sf object containing the response data |

`shapefile_names` |
List of 2: polygon id variable name and response variable name from x |

`covariate_rasters` |
SpatRaster of covariates |

`polygon_data` |
data.frame with two columns: polygon id and response |

`covariate_data` |
data.frame with cell id, polygon id and covariate columns |

`aggregation_pixels` |
vector with value of aggregation raster at each pixel |

`coordsForFit` |
coordinates of the covariate data points within the polygons in x |

`coordsForPrediction` |
coordinates of the covariate data points in the whole raster extent |

`startendindex` |
matrix containing the start and end index for each polygon |

`mesh` |
inla.mesh object to use in the fit |

### Value

A list is returned of class `disag_data`

.
The functions *summary*, *print* and *plot* can be used on `disag_data`

.
The list of class `disag_data`

contains:

`x` |
The sf object used as an input. |

`covariate_rasters` |
The SpatRaster used as an input. |

`polygon_data` |
A data frame with columns of |

`covariate_data` |
A data frame with columns of |

`aggregation_pixels` |
An array with the value of the aggregation raster for each pixel in the same order as the rows of |

`coordsForFit` |
A matrix with two columns of x, y coordinates of pixels within the polygons. Used to make the spatial field. |

`coordsForPrediction` |
A matrix with two columns of x, y coordinates of pixels in the whole Raster. Used to make predictions. |

`startendindex` |
A matrix with two columns containing the start and end index of the pixels within each polygon. |

`mesh` |
A INLA mesh to be used for the spatial field of the disaggregation model. |

*disaggregation*version 0.3.0 Index]