Return the x/y coordinates of features from a STGrid object

get_coord(object, feat_list = character(), as.factor = TRUE)

Arguments

object

The STGrid object

feat_list

The list of features.

as.factor

Whether the 'feature' column should be returned as an ordered factor.

Examples

example_dataset()
#> |-- INFO :  Dataset 11284233/files/Xenium_Mouse_Brain_Coronal_7g was already loaded. 
head(get_coord(Xenium_Mouse_Brain_Coronal_7g))
#>           x        y feature               bin_x     bin_y
#>       <num>    <num>   <ord>              <char>    <char>
#> 1: 4851.052 736.0859    Ano1 [4.83e+03,4.86e+03) [722,747)
#> 2: 4851.176 738.8480    Ano1 [4.83e+03,4.86e+03) [722,747)
#> 3: 4899.652 700.7272    Ano1 [4.88e+03,4.91e+03) [697,722)
#> 4: 4966.035 717.3051    Ano1 [4.96e+03,4.98e+03) [697,722)
#> 5: 5049.562 835.4634    Ano1 [5.03e+03,5.06e+03) [822,847)
#> 6: 5050.340 833.1196    Ano1 [5.03e+03,5.06e+03) [822,847)