-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor climdex.r into modular R scripts #36
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This commit adds the 'as.df' parameter to relevant functions, allowing users to choose whether results should be returned as data frames, including the exact date, or start and end dates of climate extremes. Additionally, utility functions like 'ymd.dates' and 'exact.date' are introduced for date handling.
QSparks
force-pushed
the
release/1.2-0-seasonal-and-exact-date-features
branch
from
October 7, 2024 19:54
f9f4e92
to
69f5750
Compare
QSparks
changed the base branch from
release/1.2-0-seasonal-and-exact-date-features
to
master
October 9, 2024 20:11
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR refactors the original
climdex.R
file by breaking it into multiple smaller, focused R scripts.There are no changes to the functionality; this is purely an organizational refactor.
R CMD check runs without errors, warnings, or notes and all tests pass.
Changes Made
Refactoring into Modular Scripts:
climdexInput_class.R
: Contains the definition of theclimdexInput
class and its associated methods, and validation routines.precipitation_indices.R
temperature_indices.R
threshold_indices.R
date_utils.R
series_utils.R
stats_utils.R
threshold_utils.R
Documentation Updates
DESCRIPTION File:
Encoding: UTF-8
to handle✖ roxygen2 requires "Encoding: UTF-8"
errorstats
andutils
to imports to handle errors such as:no visible global function definition for ‘read.csv’
Roxygen: list(markdown = TRUE)
and updatedRoxygenNote
to version7.3.2
.climdex.pcic-package.R:
.registration = TRUE
to the@useDynLib
tag so that roxygen2 would add it the namespace.@docType "package"
to_PACKAGE
.roxygen2::roxygenize(clean=T)
resolves: Refactor Climdex.r into Submodules #35