Skip to content

Commit

Permalink
Update website colours, text edits to quick start guide
Browse files Browse the repository at this point in the history
  • Loading branch information
daxkellie committed Dec 6, 2024
1 parent fc045e2 commit 29eac6b
Show file tree
Hide file tree
Showing 3 changed files with 148 additions and 8 deletions.
2 changes: 2 additions & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
url: https://corella.ala.org.au
template:
bootstrap: 5
params:
bootswatch: cerulean
navbar:
structure:
left:
Expand Down
141 changes: 138 additions & 3 deletions pkgdown/extra.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,140 @@
@import url(https://fonts.googleapis.com/css?family=Lato);
@import url(https://fonts.googleapis.com/css?family=Roboto);

.scrolly {
max-height: 100px;
overflow: auto;
h1, h2, h3, h4, .h1, .h2, .h3, .main-title, .main-subtitle {
font-family: Lato;
font-weight: normal;
color: #134348;
}

a {
color: #82c8d0;
text-decoration: none;
}

a:hover {
color: #076064;
}

body { font-family: Roboto; }

.navbar {
background: #ffffff;
transition: all 0.3s ease;
box-shadow: 0 0 10px 2px rgba(0,0,0,.15);
border: none;
min-height: 40px;
}

.navbar.bg-primary {
background-image: linear-gradient(to bottom, #ffffff, #d7eaf7) !important;
/*background-image: linear-gradient(#93d6d6, #78CCCC 60%, #6cb7b7);*/
}

.navbar-brand {
color: #e46962ff;
}

.navbar-brand:hover {
color: #82c8d0;
}

.navbar-dark .navbar-brand:hover {
color: #82c8d0;
}

.navbar-nav .nav-link {
color: #134348;
}

.navbar-nav .nav-link:hover {
color: #ffffff;
}

.navbar-nav .nav-link:focus {
color: #134348;
}

.navbar-nav .active>.nav-link {
background-color: #82c8d0;
color: #134348;
}

.nav-item:selection {
background-color: #076064;
}

.nav-item:hover {
background-color: #076064;
}

.dropdown-item:hover {
background-color: #076064;
}

.navlink:hover {
background-color: #076064;
}

.navbar-default .navbar-nav>.active>a, .navbar-default .navbar-nav>.active>a:hover, .navbar-default .navbar-nav>.active>a:focus .navbar-nav>.drop>a:hover{
color: #ffffff;
background-color: #076064;
}

.navbar-default .navbar-nav>.open>a, .navbar-default .navbar-nav>.open>a:hover, .navbar-default .navbar-nav>.open>a:focus {
color: #ffffff;
background-color: #076064;
}

.dropdown-menu>li>a:hover, .dropdown-menu>li>a:focus {
color: #ffffff;
text-decoration: none;
background-color: #076064;
}

.navbar-default .navbar-nav>li>a:hover, .navbar-default .navbar-nav>li>a:focus {
color: #ffffff;
background-color: #076064;
}

.row>main, .row>aside {
margin-top: 100px;
}

pre {
background-color: #f8fcfc;
}


.text-muted {
color: #82c8d0!important;
}

.dropdown-menu {
--bs-dropdown-bg: #d7eaf7;
}

/*
.text-muted {
color: #f5b2d0!important;
}
/*
/*.navbar a:active, .dropdown:active .dropbtn {
background-color: #003A70;
background: #003A70;
}
.dropdown > li > a:hover {
background-color: #003A70;
background: #003A70;
}
.dropdown-toggle:hover {
background-color: #003A70;
background: #003A70;
}
.li:active {
background: #003A70;
background-color: #003A70;
}*/
13 changes: 8 additions & 5 deletions vignettes/quick_start_guide.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ df |>
```


### Fix or update columns
## Fix or update columns

How do we fix the column that caused an error? One way is to edit the column within the `use_` function containing our problematic column.

Expand All @@ -120,7 +120,7 @@ df |>
decimalLatitude = as.numeric(latitude))
```

### Auto-detect columns
## Auto-detect columns

corella is also able to detect when columns already contain valid Darwin Core terms as column names. For example, `df` contains columns with locality information. We can add `use_locality()` to our pipe to specify and check these columns. Some of our columns already have valid Darwin Core terms as column names (`country` and `continent`). If we add `use_locality()` to our pipe without any arguments, it will detect these valid Darwin Core columns in `df` and check them automatically.

Expand Down Expand Up @@ -194,7 +194,7 @@ df |>

# `use_measurements`: a work in progress

Let's use a small sample of a real dataset with data on Australian native plant species including Eucalypts and Acacias. The dataset contains lots of measurement fields attached to each species occurrence that contain data the organism's traits or environment. I have extracted 3 examples: `LMA_g.m2`, `LeafN_area_g.m2`, `PNUE`.
Let's use a small sample of a real dataset of Australian native plant species, including Eucalypts and Acacias. The dataset contains lots of columns containing measurements that capture the traits or environment of each species occurrence. I have extracted 3 examples of these measurement columns: `LMA_g.m2`, `LeafN_area_g.m2`, `PNUE`.

```{r}
#| warning: false
Expand All @@ -213,7 +213,9 @@ df_filtered
```


Darwin Core confusingly handles measurement fields. This nests them and assigns them to the correct columns. You just specify the column, the unit, and the type of measurement
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`.

```{r, message=FALSE, warning=FALSE}
df_nested <- df_filtered |>
Expand All @@ -229,11 +231,12 @@ df_nested <- df_filtered |>
"photosynthetic nitrogen use efficiency")
)
df_nested |> slice(1:3)
```


Then you can unnest that column, and it will have all the correct columns formatted correctly.
To view or access this data, you can use `dplyr::unnest()`, which will extract the information into a 'long' data format.

```{r}
df_nested |>
Expand Down

0 comments on commit 29eac6b

Please sign in to comment.