Skip to content

Commit d8bbc03

Browse files
committed
update overview
1 parent dbe426a commit d8bbc03

3 files changed

Lines changed: 4922 additions & 4799 deletions

File tree

R/utils.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ length_unique <- function(x) {
66
#remove empty string
77
x <- x[!is.na(x)]
88
x <- x[x != ""]
9+
x <- x[x != "NA_NA"]
910
x <- firstup(x)
1011
length(unique(x[!is.na(x)]))
1112
}

analysis/05_overview.qmd

Lines changed: 60 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "Exploration of FunBioDiv field dataset"
2+
title: "Overview of field coordinates"
33
author: "FunBioDiv, FRB-CESAB"
44
format:
55
dashboard:
@@ -22,7 +22,6 @@ library(leaflet)
2222
library(DT)
2323
2424
devtools::load_all()
25-
# quarto::quarto_render("analysis/dev-test1.qmd")
2625
```
2726

2827
```{r load}
@@ -55,7 +54,7 @@ n <- table(meta$Study_ID)
5554
meta$Latlong <- paste(meta$Long, meta$Lat, sep = "_")
5655
missite <- tapply(
5756
meta$Plot_ID[is.na(meta$Lat)],
58-
meta$Study_ID[is.na(meta$Lat)],
57+
meta$fac_Study_ID[is.na(meta$Lat)],
5958
length_unique
6059
)
6160
study <- data.frame(
@@ -67,8 +66,8 @@ study <- data.frame(
6766
"site_missing" = ifelse(is.na(missite), 0, missite),
6867
"n_years" = tapply(meta$Year, meta$fac_Study_ID, length_unique),
6968
"n_crops" = tapply(meta$Crop_species, meta$fac_Study_ID, length_unique),
70-
"years" = tapply(meta$Year, meta$fac_Study_ID, concat),
71-
"div_crop" = tapply(meta$Crop_species, meta$fac_Study_ID, concat)
69+
"years" = tapply(meta$Year, meta$fac_Study_ID, concat) #,
70+
#"div_crop" = tapply(meta$Crop_species, meta$fac_Study_ID, concat)
7271
)
7372
7473
@@ -79,10 +78,38 @@ sd_df <- SharedData$new(
7978
)
8079
```
8180

82-
## Spatial {width=40% .tabset}
81+
# Overview
82+
83+
## Overview {width=100%}
84+
85+
### Description
86+
This is a quick overview of the dataset gathered in the [Funbiodiv project](https://www.fondationbiodiversite.fr/en/the-frb-in-action/programs-and-projects/le-cesab/funbiodiv/) **for internal use only**.
87+
88+
If you are a data provider, please have a look at the [Spatial tab](https://funbiodiv.github.io/shinyFunBioDiv/overview_Funbiodiv.html#spatial), select the project(s) of interest, and **verify that all information is correct and nothing is missing**.
89+
If your project has some missing coordinates, you can view which plot is missing in the tab [missing coordinates](https://funbiodiv.github.io/shinyFunBioDiv/overview_Funbiodiv.html#missing-coordinates).
90+
If you find any errors, please email [Axelle](mailto:axelle.tortosa@inrae.fr) or [Romain](mailto:romain.frelat@fondationbiodiversite.fr).
91+
92+
Thanks again for your help!
93+
94+
### Table
95+
```{r}
96+
DT::datatable(
97+
study,
98+
rownames = FALSE,
99+
extensions = "Scroller",
100+
width = "100%",
101+
options = list(
102+
pageLength = 15
103+
),
104+
caption = "Characteristics of the projects.'n_year_crop' is the number of plot x years x crop; 'n_plot' is the number of plot; 'unique_coordinates' is the number of unique coordinates; 'missing_coordinates' is the number of plot x years x crop with missing coordinates; 'site_missing' is the number of plot with missing coordinates; 'n_years' is the number of years with at least one plot; 'n_crops' is the number of different crops; 'years' are the different years with at least one plot. "
105+
)
106+
```
107+
108+
# Spatial
109+
110+
## Spatial {width=40%}
83111

84112
```{r map}
85-
#| title: Interactive map
86113
leaflet(sd) |>
87114
addTiles(
88115
options = providerTileOptions(minZoom = 3, maxZoom = 15)
@@ -102,22 +129,6 @@ leaflet(sd) |>
102129
)
103130
```
104131

105-
```{r}
106-
#| title: Overview table
107-
DT::datatable(
108-
study,
109-
rownames = FALSE,
110-
extensions = "Scroller",
111-
width = "100%",
112-
options = list(
113-
deferRender = TRUE,
114-
scrollY = 650,
115-
scroller = TRUE,
116-
paging = TRUE
117-
),
118-
caption = "Characteristics of the projects.'n_year_crop' is the number of plot x years x crop; 'n_plot' is the number of plot; 'unique_coordinates' is the number of unique coordinates; 'missing_coordinates' is the number of plot x years x crop with missing coordinates; 'site_missing' is the number of plot with missing coordinates; 'n_years' is the number of years with at least one plot; 'n_crops' is the number of different crops; 'years' are the different years with at least one plot; 'div_crop' contains the different crops with at least one plot. "
119-
)
120-
```
121132

122133
## Table {width=60%}
123134

@@ -145,3 +156,29 @@ DT::datatable(
145156
)
146157
)
147158
```
159+
160+
161+
# Missing coordinates
162+
163+
## Select {width=30%}
164+
165+
```{r miss}
166+
sd_miss <- SharedData$new(meta[is.na(meta$Lat), 1:4])
167+
filter_select("Study_ID", "Select a project", sd_miss, ~Study_ID)
168+
```
169+
170+
## View {width=70%}
171+
```{r}
172+
DT::datatable(
173+
sd_miss,
174+
rownames = FALSE,
175+
extensions = "Scroller",
176+
width = "100%",
177+
options = list(
178+
deferRender = TRUE,
179+
scrollY = 700,
180+
scroller = TRUE,
181+
paging = TRUE
182+
)
183+
)
184+
```

docs/overview_Funbiodiv.html

Lines changed: 4861 additions & 4776 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)