-
Notifications
You must be signed in to change notification settings - Fork 1
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
Update climate_match.R #111
Update climate_match.R #111
Conversation
#110 Function converted to work on sf package instead of sp package. World maps imported via package rnaturalworld instead of rworldwap. Possible issue: this package may consider continents a little differently (e.g., Greenland is not a part of Europe while in rworldmap it was considered a part of Europe)
Thanks @soriadelva! I would do as follows:
|
Fix bugs, rewrite code to follow up download status
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 64 in 7cd33db
#' require('rgdal') |
rgdal & rworldmap are no longer required/used. They should be removed from documentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also add dplyr::
to L286 case_when
& L296 n()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently some function outputs have nonsensical columns. For example unfiltered has a geometry
column containing point geometries while this dataframe exists of 1 row per species & climate zone combination. I would drop the geometry column using sf::st_drop_geometry()
. Alternatively we can mutate the column to contain the polygon geometries of the climate zone.
Also the case for cm & filtered.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
devtools::check()
yields the following warnings & notes
checking dependencies in R code ... WARNING
'::' or ':::' import not declared from: 'rnaturalearth'
Namespaces in Imports field not imported from:
'methods' 'raster' 'rworldmap' 'sp'
All declared Imports should be used.
❯ checking package dependencies ... NOTE
Imports includes 25 non-default packages.
Importing from so many packages makes the package vulnerable to any of
them becoming unavailable. Move as many as possible to Suggests and
use conditionally.
❯ checking top-level files ... NOTE
Non-standard file/directory found at top level:
'0073402-240229165702484.zip'
❯ checking R code for possible problems ... NOTE
apply_decision_rules: no visible binding for global variable 'n'
apply_decision_rules: no visible binding for global variable
'em_status'
apply_gam: no visible binding for global variable 'em_status'
apply_gam: no visible binding for global variable 'growth'
apply_gam: no visible binding for global variable 'method'
apply_gam: no visible binding for global variable 'smooth'
apply_gam: no visible binding for global variable 'var'
apply_gam: no visible binding for global variable 'data'
apply_gam: no visible binding for global variable 'derivative'
apply_gam: no visible binding for global variable 'se'
apply_gam: no visible binding for global variable 'crit'
apply_gam: no visible binding for global variable 'lower'
apply_gam: no visible binding for global variable 'upper'
climate_match: no visible binding for global variable 'legends'
climate_match: no visible binding for global variable 'observed'
climate_match: no visible binding for global variable 'future'
climate_match: no visible binding for global variable 'GRIDCODE2'
climate_match: no visible binding for global variable 'n_obs'
climate_match: no visible binding for global variable
'acceptedTaxonKey'
gbif_has_distribution: no visible global function definition for
'everything'
get_cred: no visible global function definition for 'setNames'
get_table_pathways: no visible binding for global variable 'n'
indicator_introduction_year: no visible binding for global variable
'key'
indicator_total_year: no visible binding for global variable 'key'
indicator_total_year: no visible binding for global variable 'year'
verify_taxa: no visible binding for global variable '.'
Undefined global functions or variables:
. GRIDCODE2 acceptedTaxonKey crit data derivative em_status
everything future growth key legends lower method n n_obs observed se
setNames smooth upper var year
Consider adding
importFrom("stats", "setNames", "smooth", "var")
importFrom("utils", "data")
to your NAMESPACE file.
PS I also did roxygen2::roxygenise()
@soriadelva I did my review of the current state if you can take a look at the devtool notes, do a A suggestion for future pimping of maps would be adding the region as a polyline to all the maps and setting the default zoom to the boundingbox of the region. |
This was done following sf_use_s2(FALSE), to make st_intersection work
… of spatialpolygonsdataframe
'\+semver:\s?(feature|minor)'
@damianooldoni, when I run the devtools::check() command I receive the following warning, would you know what to do with it?: `❯ checking data for ASCII and uncompressed saves ... WARNING
` |
Thanks @soriadelva. About the uncompressed savings issue, try to save again the .rda files using this syntax? save(your_r_object,file="your_rda_file.rda",compress="xz") |
This works, grazie! |
You are welcome. I see a lot of notes. Most of them are typically due to the fact that while developing a package, you cannot just use Can you do a screening on In any case, we are near to merge 🥳 |
@damianooldoni, I fixed all notes except those that are related to the .rda files in the /data folder. Example: |
This is done to solve the NOTE that pops up when running devtools::check()
@damianooldoni, okay to merge? :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok for me
Thanks @soriadelva. I will try my best to check all of this during the afternoon. |
Thanks @damianooldoni ! and no worries, you'll see when you have time! |
Sorry, @soriadelva. I was very busy with the preparation of the coding club of today. I will try to do it this evening. |
@damianooldoni no worries at all (sorry, I didn't mean to hurry you up!). |
This should solve some warnings returned by the actions, e.g; Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v2. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
@soriadelva was still not in the list as author.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't solved the global variable undefined for the three built-in data objects used in climate_match function. But I removed some other similar notes and updated the versions of actions in the github workflows.
And the most important stuff: I added @soriadelva as author of the package 👏 congrats!
Let's merge now.
Thanks @damianooldoni 😃 |
fixes #110
Function converted to work on sf package instead of sp package. World maps imported via package rnaturalworld instead of rworldwap. Possible issue: this package may consider continents a little differently (e.g., Greenland is not a part of Europe while in rworldmap it was considered a part of Europe)