Skip to content

Commit

Permalink
Start 1st vignette, cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
mzarowka committed Jan 24, 2024
1 parent f40818d commit 833e509
Show file tree
Hide file tree
Showing 10 changed files with 51 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@
^data-raw$
^\.github$
^LICENSE\.md$
^doc$
^Meta$
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@
.DS_Store
.quarto
docs
inst/doc
/doc/
/Meta/
11 changes: 8 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ Version: 0.0.0.9002
Authors@R: c(
person("Maurycy", "Żarczyński", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0003-2989-8152")),
person("Nicholas", "McKay", , "[email protected]", role = "aut"),
person("David", "Edge", , "[email protected]", role = "aut")
person("Nicholas", "McKay", , "[email protected]", role = "aut",
comment = c(ORCID = "0000-0003-3598-5113")),
person("David", "Edge", , "[email protected]", role = "aut",
comment = c(ORCID = "0000-0001-6938-2850"))
)
Description: A toolbox to process raw hyperspectral core scanning imaging (HSI) data. Allows normalization, filtering and visualization.
License: MIT + file LICENSE
Expand All @@ -16,7 +18,9 @@ Suggests:
testthat (>= 3.0.0),
arrow,
patchwork,
sf
sf,
knitr,
rmarkdown
Config/testthat/edition: 3
URL: https://github.com/mzarowka/HSItools
BugReports: https://github.com/mzarowka/HSItools/issues
Expand All @@ -42,3 +46,4 @@ Imports:
Depends:
R (>= 4.1.0)
LazyData: true
VignetteBuilder: knitr
6 changes: 4 additions & 2 deletions R/filters.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#' Smooth raster with focal median
#'
#' @param capture a terra SpatRaster of captured data.
#' @param raster a terra SpatRaster to smooth.
#' @param window focal window size, default is 3.
#' @param product logical, whether in the shiny pipeline, what type of filename should be used.
#' @param ... further parameters such as file path.
#'
#' @return smoothed SpatRaster
#' @export
Expand All @@ -28,7 +29,7 @@ filter_median <- function(raster = raster, window = 3, product = TRUE, ...){
# Apply terra focal statistic with 3 x 3 window
reflectance <- terra::focal(raster,
w = window,
fun = \(x) median(x),
fun = \(x) stats::median(x),
filename = filename,
overwrite = TRUE,
wopt = wopts)
Expand All @@ -49,6 +50,7 @@ filter_median <- function(raster = raster, window = 3, product = TRUE, ...){
#' @param n filter length (must be odd).
#' @param m return the m-th derivative of the filter coefficients.
#' @param ts time scaling factor.
#' @param ... further parameters such as file path.
#'
#' @return A filtered terra SpatRaster.
#' @export
Expand Down
3 changes: 1 addition & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ knitr::opts_chunk$set(
<!-- badges: start -->

[![R-CMD-check](https://github.com/mzarowka/HSItools/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/mzarowka/HSItools/actions/workflows/R-CMD-check.yaml)

<!-- badges: end -->

HSItools is an R package to process and visualize hyperspectral core scanning data.
Expand All @@ -44,5 +45,3 @@ core <- run_core()
```

Maurycy Żarczyński is founded by the Polish National Agency for Academic Exchange (BPN/BEK/2021/1/00133/U/0001).

[![National Agency for Academic Exchange logo](images/logo-nawa-white.png)](https://nawa.gov.pl)
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<!-- badges: start -->

[![R-CMD-check](https://github.com/mzarowka/HSItools/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/mzarowka/HSItools/actions/workflows/R-CMD-check.yaml)

<!-- badges: end -->

HSItools is an R package to process and visualize hyperspectral core
Expand Down Expand Up @@ -34,6 +35,3 @@ core <- run_core()

Maurycy Żarczyński is founded by the Polish National Agency for Academic
Exchange (BPN/BEK/2021/1/00133/U/0001).

[![National Agency for Academic Exchange
logo](images/logo-nawa-white.png)](https://nawa.gov.pl)
4 changes: 3 additions & 1 deletion man/filter_median.Rd

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

2 changes: 2 additions & 0 deletions man/filter_savgol.Rd

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

2 changes: 2 additions & 0 deletions vignettes/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.html
*.R
25 changes: 25 additions & 0 deletions vignettes/shiny_gui.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
title: "Graphical user interface with Shiny"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Graphical user interface with Shiny}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---

```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```

```{r setup}
library(HSItools)
```

## Run graphical interface

```{r eval=FALSE}
settings <- run_core()
```

0 comments on commit 833e509

Please sign in to comment.