Skip to content

Commit

Permalink
chore: document & examples for ext()
Browse files Browse the repository at this point in the history
  • Loading branch information
jiajic committed Apr 28, 2024
1 parent 6c81404 commit 644846f
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 5 deletions.
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
- `plot()` `giottoPoints` method now plots density when `dens = TRUE`
- `show_max` param `density()` and `hist()` to show the image object's `max_window` setting
- `.identify_background_range_polygons()` now finds any polygons larger than a threshold percentage than the overall extent of the `SpatVector` input.
- `ext()` can now be used with the `giotto` object
- `ext()` can now be used with `giotto` objects

## new
- new `spatValues()` to get specific values from a `giotto` object in `data.table` format
Expand Down
28 changes: 26 additions & 2 deletions R/methods-ext.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,33 @@
#' @param ... additional params to pass
#' @returns SpatExtent
#' @examples
#' g <- GiottoData::loadSubObjectMini("spatLocsObj")
#'
#' g <- GiottoData::loadGiottoMini("vizgen")
#' # giotto %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#' ext(g)
#'
#' # spatLocsObj %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#' sl <- getSpatialLocations(g)
#' ext(sl)
#'
#' # giottoPolygon %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#' # get extent
#' #' gpoly <- getPolygonInfo(g, return_giottoPolygon = TRUE)
#' ext(gpoly)
#'
#' # set extent
#' plot(gpoly) # before
#' ext(gpoly) <- ext(0, 20, 30, 60)
#' plot(gpoly) # after
#'
#' # giottoPoints %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#' # get extent
#' gpoints <- getFeatureInfo(g, return_giottoPoints = TRUE)
#' ext(gpoints)
#'
#' # set extent
#' plot(gpoints) # before
#' ext(gpoints) <- ext(0, 2000, 3000, 6000)
#' plot(gpoints) # after
NULL


Expand Down
45 changes: 43 additions & 2 deletions man/ext.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 644846f

Please sign in to comment.