Skip to content

Commit

Permalink
small adjustments to the types section
Browse files Browse the repository at this point in the history
  • Loading branch information
nevrome committed Oct 23, 2023
1 parent e1ccaf0 commit d81b06b
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions docs/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ mobest employs a number of basic [S3 data types](http://adv-r.had.co.nz/S3.html)

### Spatial coordinates

`mobest::create_geopos()` creates an object of class `mobest_spatialpositions` which is a `tibble` that represents spatial positions. Spatial positions in mobest are always 2-dimensional coordinates in a Cartesian space. For real world coordinates that means, that they have to be transformed to a projected coordinate system (e.g. with `sf::st_transform`): mobest can not be used with longitude and latitude coordinates (also see See {ref}`Projecting the spatial data <basic:projecting the spatial data>`).
`mobest::create_geopos()` creates an object of class `mobest_spatialpositions` which is a `tibble` that represents spatial positions. Spatial positions in mobest are always 2-dimensional coordinates in a Cartesian space. For real world coordinates that means, that they have to be transformed to a projected coordinate system (e.g. with `sf::st_transform()`): mobest can not be used with longitude and latitude coordinates (see {ref}`Projecting the spatial data <basic:projecting the spatial data>`).

```r
mobest::create_geopos(
Expand All @@ -18,11 +18,11 @@ mobest::create_geopos(
)
```

For the interpolation fields we often want regular, spatial grids covering a specific spatial area. These can be constructed with `mobest::create_prediction_grid`, which takes an object of class `sf` with polygons in a projected coordinate system. It also yields an object of class `mobest_spatialpositions`.
For the interpolation fields we often want regular, spatial grids covering a specific spatial area. These can be constructed with `mobest::create_prediction_grid()`, which takes an object of class `sf` with polygons in a projected coordinate system. It also yields an object of class `mobest_spatialpositions`.

### Spatiotemporal coordinates

`mobest_spatialpositions` can be transformed to `mobest_spatiotemporalpositions` with `mobest::geopos_to_spatpos`. This function calculates the permutations of all spatial positions with a new, implicitly temporal dimension `z`. `mobest_spatiotemporalpositions` is also derived from `tibble`.
`mobest_spatialpositions` can be transformed to `mobest_spatiotemporalpositions` with `mobest::geopos_to_spatpos()`. This function calculates the permutations of all spatial positions with a new, implicitly temporal dimension `z`. `mobest_spatiotemporalpositions` is also derived from `tibble`.

```r
mobest::geopos_to_spatpos(
Expand All @@ -35,7 +35,7 @@ mobest::geopos_to_spatpos(
)
```

`mobest::create_spatpos` directly creates `mobest_spatiotemporalpositions` objects to represent spatiotemporal positions.
`mobest::create_spatpos()` directly creates `mobest_spatiotemporalpositions` objects to represent spatiotemporal positions.

```r
mobest::create_spatpos(
Expand All @@ -57,11 +57,11 @@ mobest::create_obs(
)
```

Names and number of the components can be choosen freely, so instead of `ac1` + `ac2` as in the example here, one could, for example, also have `PC1` + `PC2` + `PC3`, or `MDS1` + `MDS2`.
Names and number of the components can be chosen freely, so instead of `ac1` + `ac2` as in the example here, one could, for example, also have `PC1` + `PC2` + `PC3`, or `MDS1` + `MDS2`.

### Kernel parameter settings

Gaussian process regression requires a parametrized covariance function: a "kernel". One `mobest_kernel` can be constructed with `mobest::create_kernel`.
Gaussian process regression requires a parametrized covariance function: a "kernel". One `mobest_kernel` can be constructed with `mobest::create_kernel()`.

```r
mobest::create_kernel(
Expand All @@ -77,7 +77,7 @@ mobest::create_kernel(
)
```

`mobest_kernel` includes these input paramaters in the form of an R `list`. It only represents one specific kernel, though, for one specific dependent variable (e.g. an ancestry component `ac1`). To account for the fact that a mobest analysis typically involves multiple genetic dimensions `mobest::create_kernset` provides a wrapper to bundle multiple named (by the dependent variable name) kernels directly in an object of class `mobest_kernelsetting`.
`mobest_kernel` includes these input parameters in the form of an R `list`. It only represents one specific kernel, though, for one specific dependent variable (e.g. an ancestry component `ac1`). To account for the fact that a mobest analysis typically involves multiple genetic dimensions `mobest::create_kernset()` provides a wrapper to bundle multiple named (by the dependent variable name) kernels directly in an object of class `mobest_kernelsetting`.

```r
mobest::create_kernset(
Expand All @@ -94,10 +94,10 @@ When working with real data we often need to explore permutations of data or acc

Available are:

- `mobest_spatialpositions_multi` (`mobest::create_geopos_multi`)
- `mobest_spatiotemporalpositions_multi` (`mobest::create_spatpos_multi`)
- `mobest_observations_multi` (`mobest::create_obs_multi`)
- `mobest_kernelsetting_multi` (`mobest::create_kernset_multi`)
- `mobest_spatialpositions_multi` (`mobest::create_geopos_multi()`)
- `mobest_spatiotemporalpositions_multi` (`mobest::create_spatpos_multi()`)
- `mobest_observations_multi` (`mobest::create_obs_multi()`)
- `mobest_kernelsetting_multi` (`mobest::create_kernset_multi()`)

And here is an example how they can be filled with named arguments:

Expand Down

0 comments on commit d81b06b

Please sign in to comment.