Skip to content

Commit

Permalink
Merge pull request #341 from 4DModeller/339-model-builder-tutorial
Browse files Browse the repository at this point in the history
Model builder tutorial
  • Loading branch information
mnky9800n authored Jan 4, 2025
2 parents 2eab457 + 7ee39ea commit 0a9cf67
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- Removed non-numeric/non-logical variable features from `shiny_modelbuilder` - [PR #341](https://github.com/4DModeller/fdmr/pull/341)
- Updated documentation for all functions to reflect better the inputs and outputs - [PR #332](https://github.com/4DModeller/fdmr/pull/332)
- Fixed an error in `model_viewer` description - [PR #331](https://github.com/4DModeller/fdmr/pull/331)
- Added to `retrieve_tutorial_data` an option to save tutorial data at a user-specified location or in a temporary directory as default - [PR #330](https://github.com/4DModeller/fdmr/pull/330)
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ BugReports: https://github.com/4DModeller/fdmr/issues
License: GPL (>= 3)
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
RoxygenNote: 7.3.2
Additional_repositories: https://inla.r-inla-download.org/R/testing
Imports:
colorspace,
Expand Down
6 changes: 3 additions & 3 deletions R/shiny_modelbuilder.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#' Interactively set and see the result of different priors
#'
#' @param spatial_data Spatial data (must be SpatialPoints or SpatialPointsDataFrame)
#' @param measurement_data Measurement data (data.frame, SpatialPointsDataFrame, SpatialPolygonsDataFrame with a named time column and at least 1 named feature column with measurements)
#' @param measurement_data Measurement data (SpatialPointsDataFrame, SpatialPolygonsDataFrame with a named time column and at least 1 named feature column with measurements)
#' @param time_variable Time variable name in measurement_data
#' @param mesh INLA/fmesher mesh
#' @param data_distribution Data distribution, Poisson or Gaussian
Expand Down Expand Up @@ -65,7 +65,7 @@ model_builder_shiny <- function(spatial_data,
citation_control_group <- "Prior explanation text modified from https://www.paulamoraga.com/book-geospatial/sec-geostatisticaldataexamplest.html"

initial_equation_val <- "formula <- model_var ~ 0 + Intercept(1)"
features <- names(measurement_data)
features <- names(measurement_data@data[base::sapply(measurement_data@data, is.numeric) | base::sapply(measurement_data@data, is.logical)])
if (is.null(features)) {
stop("We require the columns of measurement_data to have the names of the features to use in the model.")
}
Expand Down Expand Up @@ -697,7 +697,7 @@ model_builder_shiny <- function(spatial_data,
#' Interactively set and see the result of different priors
#'
#' @param spatial_data Spatial data
#' @param measurement_data Measurement data (data.frame, SpatialPointsDataFrame, SpatialPolygonsDataFrame with a named time column and at least 1 named feature column with measurements)
#' @param measurement_data Measurement data (SpatialPointsDataFrame, SpatialPolygonsDataFrame with a named time column and at least 1 named feature column with measurements)
#' @param time_variable Time variable name in measurement_data
#' @param mesh INLA/fmesher mesh
#' @param log_folder Folder to write logs to (character)
Expand Down
2 changes: 1 addition & 1 deletion man/model_builder.Rd

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

2 changes: 1 addition & 1 deletion man/model_builder_shiny.Rd

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

0 comments on commit 0a9cf67

Please sign in to comment.