namc-utah / NAMCr

NAMC Database and Analysis R API
MIT License
0 stars 0 forks source link

modelInfo error #29

Open philipbaileynar opened 2 years ago

philipbaileynar commented 2 years ago

Original issue from @Feldspar5:

modelInfo queries are returning the dreaded 4.17 error:

result = query(
        api_endpoint = "modelInfo",
        args = list(modelId = 70)
    )

or this:

> model = query("modelInfo",modelId=70)
Retrieving data: Error: 4.17: syntax error, unexpected }

Philip's response:

Pretty sure that this error is due to the arrays of predictors and/or metric Ids that this endpoint is returning:

{
    "data": {
        "modelInfo": {
            "modelId": 1,
            "modelName": "California Stream Condition Index (O/E and Multimetric Index)",
            "abbreviation": "CA_CSCI",
            "translationId": 9,
            "predictorIds": [
                90,
                93,
                94,
                95,
                98,
                100,
                53,
                65,
                64,
                99,
                92,
                2,
                4,
                183,
                185
            ],
            "extentDescription": "California",
            "platform": "R",
            "referenceSites": 474,
            "groupCount": 10,
            "minimumCount": null,
            "oeMean": 1.01074,
            "oeStdev": 0.123775,
            "taxonomicEffort": "Standard",
            "isActive": true,
            "fixedCount": 300,
            "units": null,
            "description": "",
            "predictorCount": 15,
            "createdDate": "2021-11-17T04:17:21.957034+00:00",
            "updatedDate": "2021-11-17T04:17:21.957034+00:00"
        }
    }
}