Skip to content

Commit

Permalink
docs: refinements for CRAN
Browse files Browse the repository at this point in the history
  • Loading branch information
jkennedyie committed Jul 19, 2024
1 parent 843436c commit 4ffd196
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 37 deletions.
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# igr (development version)
# igr 0.1.0

* Initial CRAN submission.
19 changes: 7 additions & 12 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,14 @@ To install the production version of igr from CRAN:
``` r
install.packages("igr")
```
To install the development version of igr:
To install the development version of igr from GitHub:

``` r
# Install devtools package if needed
install.packages("devtools")

# Load devtools package if needed
library(devtools)

# Install development version of igr package from github
install_github("digitalnature-ie/igr")

# Install development version of igr package from GitHub
devtools::install_github("digitalnature-ie/igr")
```
## Usage

Expand Down Expand Up @@ -129,7 +125,7 @@ polygons_sf <- st_igr_as_sf(igrs_df, "igr", polygons = TRUE)
polygons_sf$area <- sf::st_area(polygons_sf)
small_polygons_sf <- polygons_sf[polygons_sf$area <= units::set_units(1000000, m^2),]
small_polygons_sf <- polygons_sf[polygons_sf$area <= units::set_units(1000000, m^2), ]
tm_shape(ie_uk_sf, bbox = points_sf, ext = 1.4) +
Expand All @@ -139,10 +135,9 @@ tm_shape(ie_uk_sf, bbox = points_sf, ext = 1.4) +
tm_text("igr", ymod = -1) +
tm_shape(small_polygons_sf) +
tm_bubbles(
alpha = 0, border.col = "orangered", border.lwd = 2,
size = 0.8
)
alpha = 0, border.col = "orangered", border.lwd = 2,
size = 0.8
)
```

### Convert to Irish grid references
Expand Down
24 changes: 9 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,20 @@ any coordinate reference system.

## Installation

To install the development version of igr:
To install the production version of igr from CRAN:

``` r
install.packages("igr")
```

To install the development version of igr from GitHub:

``` r
# Install devtools package if needed
install.packages("devtools")

# Load devtools package if needed
library(devtools)

# Install development version of igr package from github
install_github("digitalnature-ie/igr")
# Install development version of igr package from GitHub
devtools::install_github("digitalnature-ie/igr")
```

## Usage
Expand Down Expand Up @@ -102,9 +105,6 @@ igr_to_ig(igrs)
#>
#> $y
#> [1] 400000 420000 330000 290000 227400 150000 0
```

``` r
# Sample grid references in a data.frame
igrs_df <- data.frame(igr = igrs)

Expand Down Expand Up @@ -159,15 +159,9 @@ p
#> [1,] 0 490000
#> [2,] 400000 0
#> [3,] 453000 4000
```

``` r
# Convert to Irish grid references
ig_to_igr(p)
#> [1] "A000900" "Z000000" "Z530040"
```

``` r
# Sample Irish Grid coordinates in an sf object
p_sf <- sf::st_as_sf(data.frame(p), crs = 29903, coords = c("x", "y"))

Expand Down
2 changes: 1 addition & 1 deletion man/igr-package.Rd

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

18 changes: 10 additions & 8 deletions vignettes/igr.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,27 @@ The Irish Grid ([EPSG:29903](https://epsg.io/29903)) is a coordinate reference s

Irish grid references are an alternative way of recording locations on the Irish Grid. An Irish grid reference consists of a letter, optionally followed by an easting and northing. The letter (e.g. "N") refers to a particular 100 km square on the Irish Grid. There are 25 such 100 km squares - the letter "I" is skipped. The easting and northing refer to a square within the 100 km square. An Irish grid reference with a 1-digit easting and northing (e.g. "N85") refers to a particular 10 km square wtihin the 100 km square "N". A 5-digit easting and northing (e.g. "N 12345 67890") refers to a particular 1 m square.

There are many R packages facilitating [spatial data analysis and visualisation](https://cran.r-project.org/web/views/Spatial.html). The igr package is designed to simplify using datasets containing Irish grid references in R. It translates Irish grid references into Irish Grid coordinates or sf objects that other R packages can work with. The igr package supports precisions of Irish grid reference in multiples of ten from 1 m to 100 km, mixes of precision, and Irish grid references with or without whitespace between letter, easting and northing.
There are many R packages facilitating [spatial data analysis and visualisation](https://cran.r-project.org/view=Spatial). The igr package is designed to simplify using datasets containing Irish grid references in R. It translates Irish grid references into Irish Grid coordinates or sf objects that other R packages can work with. The igr package supports precisions of Irish grid reference in multiples of ten from 1 m to 100 km, mixes of precision, and Irish grid references with or without whitespace between letter, easting and northing.

When converting Irish grid references to point locations (using `igr_to_ig()`, or `st_igr_as_sf()` with the default `polygons=FALSE`), the south west corners of the relevant Irish Grid squares are returned. When converting to polygons (using `st_igr_as_sf()` with `polygons=TRUE`), the polygons returned span the entire square of each grid reference.

The functions `st_igr_as_sf()` and `st_irishgridrefs()` convert to and from [sf](https://r-spatial.github.io/sf/) (simple feature) objects in any coordinate reference system.

## Installation

The development version of igr can be installed from github as follows:
To install the production version of igr from CRAN:

```{r install, eval=FALSE}
``` r
install.packages("igr")
```
To install the development version of igr from GitHub:

``` r
# Install devtools package if needed
install.packages("devtools")

# Load devtools package if needed
library(devtools)
# Install development version of igr package from github
install_github("digitalnature-ie/igr")
# Install development version of igr package from GitHub
devtools::install_github("digitalnature-ie/igr")
```

## Loading the package
Expand Down

0 comments on commit 4ffd196

Please sign in to comment.