Skip to content

Commit 0a9cf67

Browse files
authored
Merge pull request #341 from 4DModeller/339-model-builder-tutorial
Model builder tutorial
2 parents 2eab457 + 7ee39ea commit 0a9cf67

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Fixed
1111

12+
- Removed non-numeric/non-logical variable features from `shiny_modelbuilder` - [PR #341](https://github.com/4DModeller/fdmr/pull/341)
1213
- Updated documentation for all functions to reflect better the inputs and outputs - [PR #332](https://github.com/4DModeller/fdmr/pull/332)
1314
- Fixed an error in `model_viewer` description - [PR #331](https://github.com/4DModeller/fdmr/pull/331)
1415
- 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)

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ BugReports: https://github.com/4DModeller/fdmr/issues
1616
License: GPL (>= 3)
1717
Encoding: UTF-8
1818
Roxygen: list(markdown = TRUE)
19-
RoxygenNote: 7.2.3
19+
RoxygenNote: 7.3.2
2020
Additional_repositories: https://inla.r-inla-download.org/R/testing
2121
Imports:
2222
colorspace,

R/shiny_modelbuilder.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#' Interactively set and see the result of different priors
22
#'
33
#' @param spatial_data Spatial data (must be SpatialPoints or SpatialPointsDataFrame)
4-
#' @param measurement_data Measurement data (data.frame, SpatialPointsDataFrame, SpatialPolygonsDataFrame with a named time column and at least 1 named feature column with measurements)
4+
#' @param measurement_data Measurement data (SpatialPointsDataFrame, SpatialPolygonsDataFrame with a named time column and at least 1 named feature column with measurements)
55
#' @param time_variable Time variable name in measurement_data
66
#' @param mesh INLA/fmesher mesh
77
#' @param data_distribution Data distribution, Poisson or Gaussian
@@ -65,7 +65,7 @@ model_builder_shiny <- function(spatial_data,
6565
citation_control_group <- "Prior explanation text modified from https://www.paulamoraga.com/book-geospatial/sec-geostatisticaldataexamplest.html"
6666

6767
initial_equation_val <- "formula <- model_var ~ 0 + Intercept(1)"
68-
features <- names(measurement_data)
68+
features <- names(measurement_data@data[base::sapply(measurement_data@data, is.numeric) | base::sapply(measurement_data@data, is.logical)])
6969
if (is.null(features)) {
7070
stop("We require the columns of measurement_data to have the names of the features to use in the model.")
7171
}
@@ -697,7 +697,7 @@ model_builder_shiny <- function(spatial_data,
697697
#' Interactively set and see the result of different priors
698698
#'
699699
#' @param spatial_data Spatial data
700-
#' @param measurement_data Measurement data (data.frame, SpatialPointsDataFrame, SpatialPolygonsDataFrame with a named time column and at least 1 named feature column with measurements)
700+
#' @param measurement_data Measurement data (SpatialPointsDataFrame, SpatialPolygonsDataFrame with a named time column and at least 1 named feature column with measurements)
701701
#' @param time_variable Time variable name in measurement_data
702702
#' @param mesh INLA/fmesher mesh
703703
#' @param log_folder Folder to write logs to (character)

man/model_builder.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/model_builder_shiny.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)