ropensci / ReLTER

An Interface for the 'eLTER' Community
http://docs.ropensci.org/ReLTER
GNU General Public License v3.0
12 stars 6 forks source link

Function getILTERParameters() and getILTERGeneralInfo fail without sitenum paramter #9

Closed micha-silver closed 3 years ago

micha-silver commented 3 years ago

THese functions should run with no parameter and return a tibble for all DEIMS sites. However the sitenum default value is set to NULL instead of NA, then the test for sitenum fails:

> getILTERParameters()
Error in if (is.na(sitesNum)) { : argument is of length zero
> getILTERGeneralInfo()
Error in if (is.na(sitesNum)) { : argument is of length zero

The default sitenum value in function definition should be NA (instead of NULL)

> getILTERGeneralInfo(NA)
 Imported 1 records. Simplifying...
 Imported 1 records. Simplifying...
 Imported 1 records. Simplifying...
 Imported 1 records. Simplifying...
 .....
oggioniale commented 3 years ago

Dear Micha, with the new release both work fine. Please let me know.

Ale

micha-silver commented 3 years ago
body p { margin-bottom: 0cm; margin-top: 0pt; } 

Many thanks.
I'll have a look in the coming days.

Kind regards,
Micha

On 10/19/21 10:16 AM, Alessandro
  Oggioni wrote:

  Dear Micha,
    with the new release both work fine.
    Please let me know.
  Ale
  —
    You are receiving this because you authored the thread.
    Reply to this email directly, view it on GitHub, or unsubscribe.
    Triage notifications on the go with GitHub Mobile for iOS or Android.

  [

{ @.": "http://schema.org", @.": "EmailMessage", "potentialAction": { @.": "ViewAction", "target": "https://github.com/oggioniale/ReLTER/issues/9#issuecomment-946431120", "url": "https://github.com/oggioniale/ReLTER/issues/9#issuecomment-946431120", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { @.": "Organization", "name": "GitHub", "url": "https://github.com" } } ]

-- 

Micha Silver Ben Gurion Univ. Sde Boker, Remote Sensing Lab cell: +972-523-665918 https://orcid.org/0000-0002-1128-1325

oggioniale commented 3 years ago

Sorry @micha-silver I don't understand where, what is the error.

micha-silver commented 3 years ago

I see:

> p <- getSiteParameters()
Error in sub("^.+/", "", deimsid) : 
  argument "deimsid" is missing, with no default

If the function parameter is set to NA by default, then a check for is.na(deimsid) will be TRUE, and you can catch that user error (no deims id supplied).

micha-silver commented 3 years ago

But this is really trivial.... maybe it can be ignored.