Skip to content

Commit

Permalink
Fix site building, fix favicons
Browse files Browse the repository at this point in the history
  • Loading branch information
daxkellie committed Jan 7, 2025
1 parent e78ed9b commit c42875f
Show file tree
Hide file tree
Showing 14 changed files with 782 additions and 7,825 deletions.
3 changes: 3 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ importFrom(cli,cli_h2)
importFrom(cli,cli_h3)
importFrom(cli,cli_inform)
importFrom(cli,cli_par)
importFrom(cli,cli_progress_done)
importFrom(cli,cli_progress_step)
importFrom(cli,cli_progress_update)
importFrom(cli,cli_rule)
Expand All @@ -64,6 +65,7 @@ importFrom(dplyr,group_split)
importFrom(dplyr,join_by)
importFrom(dplyr,mutate)
importFrom(dplyr,pull)
importFrom(dplyr,row_number)
importFrom(dplyr,select)
importFrom(dplyr,slice_head)
importFrom(glue,glue)
Expand All @@ -81,6 +83,7 @@ importFrom(lubridate,ymd_hm)
importFrom(lubridate,ymd_hms)
importFrom(purrr,keep)
importFrom(purrr,map)
importFrom(purrr,map_dfr)
importFrom(purrr,pluck)
importFrom(rlang,.data)
importFrom(rlang,abort)
Expand Down
5 changes: 5 additions & 0 deletions R/use_measurements.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#' @importFrom rlang abort
#' @importFrom rlang enquos
#' @importFrom cli cli_progress_step
#' @importFrom cli cli_progress_done
#' @importFrom dplyr row_number
#' @importFrom purrr map_dfr
#' @export
Expand Down Expand Up @@ -55,6 +56,8 @@ use_measurements <- function(
nest(measurementOrFact = c(padded_row_number, !!!fn_quos))
)

cli_progress_done()

# Pivots each row's data to long
# Adds rowwise `unit` and `type` information to each nested tibble
cli_progress_step("Converting measurements to Darwin Core")
Expand All @@ -75,6 +78,8 @@ use_measurements <- function(
select(-column_name, -padded_row_number)
))

cli_progress_done()

# if(!is.null(result$measurementOrFact)) {
# matched_cols = result |>
# select(measurementOrFact) |>
Expand Down
2 changes: 1 addition & 1 deletion man/check_dataset.Rd

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

Binary file added man/figures/corella-logo-lagoon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pkgdown/favicon/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pkgdown/favicon/favicon-96x96.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pkgdown/favicon/favicon.ico
Binary file not shown.
7,817 changes: 1 addition & 7,816 deletions pkgdown/favicon/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pkgdown/favicon/web-app-manifest-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pkgdown/favicon/web-app-manifest-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 5 additions & 2 deletions vignettes/checking-your-dataset.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ vignette: >
%\VignetteIndexEntry{Checking your dataset}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
resource_files:
- 'supported-terms.csv'
---

A Darwin Core Archive consists of several pieces to ensure a dataset is structured correctly (and can be restructured correctly in the future). These pieces include the dataset, a metadata statement, and an xml file detailing how the columns in the data relate to each other.
Expand Down Expand Up @@ -67,8 +69,9 @@ corella contains internal `check_` functions for all individual Darwin Core term
library(gt)
library(dplyr)
readr::read_csv(system.file("./supported-terms.csv",
package = "corella")) |>
object <- read.csv("./supported-terms.csv")
object |>
select(-1) |> # remove reference column
mutate(
check_function = glue::glue("check_{dwc_term}()")
Expand Down
11 changes: 5 additions & 6 deletions vignettes/quick_start_guide.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ vignette: >
%\VignetteIndexEntry{Quick start guide}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
resource_files:
- './westerband_2022_wdate.csv'
---

```{r, include = FALSE}
Expand Down Expand Up @@ -208,10 +210,7 @@ library(dplyr)
library(tidyr)
# take a small sample
df_filtered <- system.file("extdata",
"westerband_2022_wdate.csv",
package = "corella") |>
read_csv() |>
df_filtered <- read.csv("./westerband_2022_wdate.csv") |>
select(Site, Species, Latitude, Longitude, LMA_g.m2, LeafN_area_g.m2, PNUE)
df_filtered
Expand All @@ -220,7 +219,7 @@ df_filtered

The way that Darwin Core handles measurement fields is slightly different to how they are organised in these data. In `df_filtered`, lots of information about what data the column contains is in the abbreviated column name. This includes the type of measure, the unit it is measured in, and the value itself. In Darwin Core, this information needs to be documented individually for each measurement, which requires multiple columns and multiple rows (ie a 'long' data format).

corella can convert measurement columns into Darwin Core standard with `use_measurements()`. This function requires the column, unit and measure type are specified for each respective measurement, after which `use_measurements()` assigns this information to the correct Darwin Core columns. `use_measurements()` then nests them so that they information is linked to each species occurrence, held in a nested column called `measurementOrFact`.
corella can convert measurement columns into Darwin Core standard with `use_measurements()`. This function requires users to specify the column, unit and measure type for each respective measurement. `use_measurements()` then assigns this information to the correct Darwin Core columns, and nests these columns into a nested column called `measurementOrFact`.

```{r, message=FALSE, warning=FALSE}
df_nested <- df_filtered |>
Expand All @@ -241,7 +240,7 @@ df_nested |> slice(1:3)
```


To view or access this data, you can use `dplyr::unnest()`, which will extract the information into a 'long' data format.
This nested structure allows the newly formatted information (now in long format) to still link correctly to each species occurrence. To view or access this now-standardised long-format data, use `dplyr::unnest()`.

```{r}
df_nested |>
Expand Down
Loading

0 comments on commit c42875f

Please sign in to comment.