Comments (6)
Totally agree. Much better way of handling things. And jsonlite does exactly the right thing:
regions = list(PR = c("59"))
jsonlite::toJSON(regions)
yields
{"PR":["59"]}
from cancensus.
It looks like it also does the right thing in the likely case, which is when users don't wrap arguments in c()
:
> jsonlite::toJSON(list(PR = "35", CMA = c("59155", "59255")))
# {"PR":["35"],"CMA":["59155","59255"]}
from cancensus.
I'll take a crack at implementing this shortly.
from cancensus.
Can we type-check if "regions" is a string and just continue as before in that case? Not really much extra work and the cold falls back gracefully while we transition over the function calls. We could put in a depreciation warning and phase it out in a couple of weeks.
from cancensus.
@mountainMath I've implemented this in #29.
from cancensus.
Merged PR #29
from cancensus.
Related Issues (20)
- Bad dependency checks behaviour HOT 6
- Update examples and vignettes for Census 2021 data where appropriate HOT 1
- conflicting namespace HOT 2
- Translation for dataset identifiers HOT 1
- Cross tabulations
- Duplicate vector numbers HOT 2
- Unique CSD names HOT 1
- 1996's DAs calls with province region returns an empty dataframe HOT 2
- WDS endpoint HOT 1
- Original census geographies HOT 2
- Responses get_census() function are just integers divisibles by 5 or "rounded" HOT 2
- Better error message on bulk download requests
- Error when requesting empty regions in 'sf' call.
- [feature request] querying shapes directly HOT 2
- GPT 4 Cancensus HOT 1
- Some CMAs and their provincial sub-parts have the same population values HOT 2
- rgdal and rgeos dependencies HOT 3
- Error: No API key set. HOT 5
- rgdal and rgeos archived
- Broken file paths in get_statcan_geo_suite() HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cancensus.