I am trying to pass the following JSON into a function in R.
The raw JSON
{
"type": "Polygon",
"coordinates": [
[
[-122.68,42.77],
[-116.53,42.77],
[-116.53,44.30],
[-122.68,44.30],
[-122.68,42.77]
]
]
}
And here's the call to an R function:
myfunction(api_endpoint="my_api_endpoint", args=list(arg1 = 2000, arg2=MY_JSON_HERE)
I have tried escaping quotes, wrapping in single quotes and I keep getting errors about curly braces etc.
How do I take that literal JSON string and send it into an R function please?