Description Usage Arguments Details See Also Examples

This function calls the generic function `auto_BAU`

(not exported) after a series of checks and is the easiest way to generate a set of Basic Areal Units (BAUs) on the manifold being used; see details.

1 2 3 |

`manifold` |
object of class |

`type` |
either “grid” or “hex”, indicating whether gridded or hexagonal BAUs should be used |

`cellsize` |
denotes size of gridcell when |

`isea3h_res` |
resolution number of the isea3h DGGRID cells for when type is “hex” and manifold is the surface of a |

`data` |
object of class |

`nonconvex_hull` |
flag indicating whether to use |

`convex` |
convex parameter used for smoothing an extended boundary when working on a bounded domain (that is, when the object |

`tunit` |
temporal unit when requiring space-time BAUs. Can be "secs", "mins", "hours", etc. |

`xlims` |
limits of the horizontal axis (overrides automatic selection) |

`ylims` |
limits of the vertical axis (overrides automatic selection) |

`...` |
currently unused |

`auto_BAUs`

constructs a set of Basic Areal Units (BAUs) used both for data pre-processing and for prediction. As such, the BAUs need to be of sufficienly fine resolution so that inferences are not affected due to binning.

Two types of BAUs are supported by `FRK`

: “hex” (hexagonal) and “grid” (rectangular). In order to have a “grid” set of BAUs, the user should specify a cellsize of length one, or of length equal to the dimensions of the manifold, that is, of length 1 for `real_line`

and of length 2 for the surface of a `sphere`

and `plane`

. When a “hex” set of BAUs is desired, the first element of `cellsize`

is used to determine the side length by dividing this value by approximately 2. The argument `type`

is ignored with `real_line`

and “hex” is not available for this manifold.

If the object `data`

is provided, then automatic domain selection may be carried out by employing the `INLA`

function `inla.nonconvex.hull`

, which finds a (non-convex) hull surrounding the data points (or centroids of the data polygons). This domain is extended and smoothed using the parameter `convex`

. The parameter `convex`

should be negative, and a larger absolute value for `convex`

results in a larger domain with smoother boundaries (note that `INLA`

was not available on CRAN at the time of writing).

`auto_basis`

for automatically constructing basis functions.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | ```
## First a 1D example
library(sp)
set.seed(1)
data <- data.frame(x = runif(10)*10, y = 0, z= runif(10)*10)
coordinates(data) <- ~x+y
Grid1D_df <- auto_BAUs(manifold = real_line(),
cellsize = 1,
data=data)
## Not run: spplot(Grid1D_df)
## Now a 2D example
data(meuse)
coordinates(meuse) = ~x+y # change into an sp object
## Grid BAUs
GridPols_df <- auto_BAUs(manifold = plane(),
cellsize = 200,
type = "grid",
data = meuse,
nonconvex_hull = 0)
## Not run: plot(GridPols_df)
## Hex BAUs
HexPols_df <- auto_BAUs(manifold = plane(),
cellsize = 200,
type = "hex",
data = meuse,
nonconvex_hull = 0)
## Not run: plot(HexPols_df)
``` |

```
```

FRK documentation built on May 2, 2019, 8:11 a.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.