Skip to content

Commit

Permalink
added license & # REFERENCES (knitcitations) to v3 modules
Browse files Browse the repository at this point in the history
  • Loading branch information
bjohnso005 committed Oct 18, 2024
1 parent 2df372e commit 5527f0d
Show file tree
Hide file tree
Showing 16 changed files with 329 additions and 12 deletions.
25 changes: 25 additions & 0 deletions inst/shiny/custom_modules/occs_biomodelos.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
# Wallace EcoMod: a flexible platform for reproducible modeling of
# species niches and distributions.
#
# occs_biomodelos.R
# File author: Wallace EcoMod Dev Team. 2023.
# --------------------------------------------------------------------------
# This file is part of the Wallace EcoMod application
# (hereafter “Wallace”).
#
# Wallace is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License,
# or (at your option) any later version.
#
# Wallace is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Wallace. If not, see <http://www.gnu.org/licenses/>.
# --------------------------------------------------------------------------
#
occs_biomodelos_module_ui <- function(id) {
ns <- shiny::NS(id)
tagList(
Expand Down Expand Up @@ -34,6 +57,8 @@ occs_biomodelos_module_server <- function(input, output, session, common) {
occsCleaned = occs),
rmm = rangeModelMetadata::rmmTemplate(),
rmd = list())
# REFERENCES ####
knitcitations::citep(citation("httr"))

# METADATA ####
spp[[sp]]$rmm$data$occurrence$taxon <- sp
Expand Down
4 changes: 2 additions & 2 deletions inst/shiny/custom_modules/occs_biomodelos.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
component: "occs"
short_name: "Query BioModelos"
long_name: "Query BioModelos"
authors: "GEPB (**)"
package: []
authors: "GEPB, Bethany A. Johnson"
package: [httr]
23 changes: 23 additions & 0 deletions inst/shiny/custom_modules/rep_biomodelos.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
# Wallace EcoMod: a flexible platform for reproducible modeling of
# species niches and distributions.
#
# rep_biomodelos.R
# File author: Wallace EcoMod Dev Team. 2023.
# --------------------------------------------------------------------------
# This file is part of the Wallace EcoMod application
# (hereafter “Wallace”).
#
# Wallace is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License,
# or (at your option) any later version.
#
# Wallace is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Wallace. If not, see <http://www.gnu.org/licenses/>.
# --------------------------------------------------------------------------
#
rep_biomodelos_module_ui <- function(id) {
ns <- shiny::NS(id)
tagList(
Expand Down
31 changes: 31 additions & 0 deletions inst/shiny/modules/diver_endemism.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
# Wallace EcoMod: a flexible platform for reproducible modeling of
# species niches and distributions.
#
# diver_endemism.R
# File author: Wallace EcoMod Dev Team. 2023.
# --------------------------------------------------------------------------
# This file is part of the Wallace EcoMod application
# (hereafter “Wallace”).
#
# Wallace is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License,
# or (at your option) any later version.
#
# Wallace is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Wallace. If not, see <http://www.gnu.org/licenses/>.
# --------------------------------------------------------------------------
#
diver_endemism_module_ui <- function(id) {
ns <- shiny::NS(id)
tagList(
Expand Down Expand Up @@ -140,10 +163,18 @@ diver_endemism_module_server <- function(input, output, session, common) {
# FUNCTION CALL ####
req(endemism)
logger %>% writeLog("Species endemism calculated.")

# LOAD INTO SPP ####
multi.sp$endemism <- endemism
multi.sp$sppEndemism <- curSp()
common$update_component(tab = "Map")

# REFERENCES ####
knitcitations::citep(citation("raster"))
knitcitations::citep(citation("changeRangeR"))

# METADATA ####
# add metadata
})

output$result <- renderPrint({
Expand Down
3 changes: 2 additions & 1 deletion inst/shiny/modules/diver_endemism.Rmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
```{asis, echo = {{diver_endemism_knit}}, eval = {{diver_endemism_knit}}, include = {{diver_endemism_knit}}}
#
### Calculate endemism
Write something here about what is going on...
```

```{r, echo = {{diver_endemism_knit}}, include = {{diver_endemism_knit}}}
Expand Down
30 changes: 30 additions & 0 deletions inst/shiny/modules/diver_richness.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
# Wallace EcoMod: a flexible platform for reproducible modeling of
# species niches and distributions.
#
# diver_richness.R
# File author: Wallace EcoMod Dev Team. 2023.
# --------------------------------------------------------------------------
# This file is part of the Wallace EcoMod application
# (hereafter “Wallace”).
#
# Wallace is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License,
# or (at your option) any later version.
#
# Wallace is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Wallace. If not, see <http://www.gnu.org/licenses/>.
# --------------------------------------------------------------------------
#
diver_richness_module_ui <- function(id) {
ns <- shiny::NS(id)
tagList(
Expand Down Expand Up @@ -140,10 +163,17 @@ diver_richness_module_server <- function(input, output, session, common) {

req(richness)
logger %>% writeLog("Species richness calculated.")

# LOAD INTO SPP ####
multi.sp$richness <- richness
multi.sp$sppRichness <- curSp()
common$update_component(tab = "Map")

# REFERENCES ####
knitcitations::citep(citation("raster"))

# METADATA ####
#add metadata
})

return(list(
Expand Down
2 changes: 1 addition & 1 deletion inst/shiny/modules/diver_richness.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
component: "diver"
short_name: "Calculate Richness"
long_name: "Calculate Richness"
authors: "Andrea Paz"
authors: "Andrea Paz, Bethany A. Johnson"
package: [raster]
30 changes: 30 additions & 0 deletions inst/shiny/modules/indic_overlap.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
# Wallace EcoMod: a flexible platform for reproducible modeling of
# species niches and distributions.
#
# indic_overlap.R
# File author: Wallace EcoMod Dev Team. 2023.
# --------------------------------------------------------------------------
# This file is part of the Wallace EcoMod application
# (hereafter “Wallace”).
#
# Wallace is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License,
# or (at your option) any later version.
#
# Wallace is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Wallace. If not, see <http://www.gnu.org/licenses/>.
# --------------------------------------------------------------------------
#
indic_overlap_module_ui <- function(id) {
ns <- shiny::NS(id)
tagList(
Expand Down Expand Up @@ -310,6 +333,13 @@ indic_overlap_module_server <- function(input, output, session, common) {
spp[[curSp()]]$indic$overlapFields <- overlapF
spp[[curSp()]]$indic$overlapCat <- overlapC
common$update_component(tab = "Results")

# REFERENCES ####
knitcitations::citep(citation("raster"))
knitcitations::citep(citation("changeRangeR"))

# METADATA ####
# add metadata
})

output$result <- renderUI({
Expand Down
30 changes: 30 additions & 0 deletions inst/shiny/modules/indic_range.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
# Wallace EcoMod: a flexible platform for reproducible modeling of
# species niches and distributions.
#
# indic_range.R
# File author: Wallace EcoMod Dev Team. 2023.
# --------------------------------------------------------------------------
# This file is part of the Wallace EcoMod application
# (hereafter “Wallace”).
#
# Wallace is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License,
# or (at your option) any later version.
#
# Wallace is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Wallace. If not, see <http://www.gnu.org/licenses/>.
# --------------------------------------------------------------------------
#
indic_range_module_ui <- function(id) {
ns <- shiny::NS(id)
tagList(
Expand Down Expand Up @@ -220,6 +243,13 @@ indic_range_module_server <- function(input, output, session, common) {
spp[[curSp()]]$flags$indicAreaMap <- "aoo"
common$update_component(tab = "Map")
}

# REFERENCES ####
knitcitations::citep(citation("raster"))
knitcitations::citep(citation("changeRangeR"))

# METADATA ####
# add metadata
})

output$areas <- renderText({
Expand Down
30 changes: 30 additions & 0 deletions inst/shiny/modules/indic_time.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
# Wallace EcoMod: a flexible platform for reproducible modeling of
# species niches and distributions.
#
# indic_time.R
# File author: Wallace EcoMod Dev Team. 2023.
# --------------------------------------------------------------------------
# This file is part of the Wallace EcoMod application
# (hereafter “Wallace”).
#
# Wallace is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License,
# or (at your option) any later version.
#
# Wallace is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Wallace. If not, see <http://www.gnu.org/licenses/>.
# --------------------------------------------------------------------------
#
indic_time_module_ui <- function(id) {
ns <- shiny::NS(id)
tagList(
Expand Down Expand Up @@ -278,6 +301,13 @@ indic_time_module_server <- function(input, output, session, common) {
spp[[curSp()]]$indic$areaTime <- rangeArea
spp[[curSp()]]$indic$years <- years
common$update_component(tab = "Results")

# REFERENCES ####
knitcitations::citep(citation("raster"))
knitcitations::citep(citation("changeRangeR"))

# METADATA ####
# add metadata
})

output$timeAreas <- renderUI({
Expand Down
29 changes: 29 additions & 0 deletions inst/shiny/modules/mask_expPoly.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
# Wallace EcoMod: a flexible platform for reproducible modeling of
# species niches and distributions.
#
# mask_expPoly.R
# File author: Wallace EcoMod Dev Team. 2023.
# --------------------------------------------------------------------------
# This file is part of the Wallace EcoMod application
# (hereafter “Wallace”).
#
# Wallace is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License,
# or (at your option) any later version.
#
# Wallace is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Wallace. If not, see <http://www.gnu.org/licenses/>.
# --------------------------------------------------------------------------
#
mask_expPoly_module_ui <- function(id) {
ns <- shiny::NS(id)
tagList(
Expand Down Expand Up @@ -299,6 +322,12 @@ mask_expPoly_module_server <- function(input, output, session, common) {
type = "error", hlSpp(curSp()),
"The polygon was already used. Define a new one (**)")
}

# REFERENCES ####
knitcitations::citep(citation("raster"))

# METADATA ####
#add metadata
})

# Reset prediction
Expand Down
28 changes: 28 additions & 0 deletions inst/shiny/modules/mask_spatial.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
# Wallace EcoMod: a flexible platform for reproducible modeling of
# species niches and distributions.
#
# mask_spatial.R
# File author: Wallace EcoMod Dev Team. 2023.
# --------------------------------------------------------------------------
# This file is part of the Wallace EcoMod application
# (hereafter “Wallace”).
#
# Wallace is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License,
# or (at your option) any later version.
#
# Wallace is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Wallace. If not, see <http://www.gnu.org/licenses/>.
# --------------------------------------------------------------------------
#
mask_spatial_module_ui <- function(id) {
ns <- shiny::NS(id)
tagList(
Expand Down Expand Up @@ -190,7 +213,12 @@ mask_spatial_module_server <- function(input, output, session, common) {
logger %>% writeLog(
hlSpp(curSp()), "Spatial Masked (**)")

# REFERENCES ####
knitcitations::citep(citation("sp"))
knitcitations::citep(citation("sf"))

# METADATA ####
#add metadata
})

# Reset prediction
Expand Down
Loading

0 comments on commit 5527f0d

Please sign in to comment.