R is a programming language and free software environment for statistical computing and graphics supported by the R Core Team and the R Foundation for Statistical Computing. It is widely used among statisticians and data miners for developing statistical software and data analysis.
The R code is fairly simple โ just grab the JSON from the server and use purrr to map over the various styles. The returned tibble contains the value returned from the server, along with the label and fill color.
I keep telling myself that I should do more Python programming as itโs the future and R is a dying language. R isnโt the most popular language compared to Python.
But the thing is Python remains far behind R when it comes to map making and graphics. And there is a ton of useful packages out there for R, sometimes much better packages for R then Python especially when it comes to graphics and light manipulation of data, especially Census data. PANDAS might be better for heavy lifting then tidyverse but for many things the tidyverse is simpler.
Yet I concede R is a like adopting the Macintosh System 7 platform decades ago in the era of Windows 95. Your simply not using what the masses are using and you are somewhat locked out of benefits of a popular platform. Moreover, the underlying code in R is often slow and inefficient, with a legacy of 50 year old designs unlike the relatively modern clean and elegant of Python. Much like Macintosh System 7 compared to Windows 95. Macintosh System 7 did a lot of things good in graphics and user interface but the underpinning were a hot mess of hacks built on code from the early 1980s. Windows 95 had protected memory and preemptive multitasking while System 7 was stuck in the era of shared memory and cooperative multitasking.
But R is different than Macintosh System 7. R might be creaky and old but itโs actively maintained and unlikely to be killed off with a single shot by a corporation like Apple did with Macintosh System 7 with the release of Mac OS X. R programming will last forever even if it eventually dies out to Python as itโs open source and not controlled by a profit seeking corporation. Old R code is unlikely to stop working, as there is enough existing code base that interpretive environments are likely to be maintained just like how GNU FORTRAN still is a thing despite little new FORTRAN code written anymore.
Yet my bigger fear is that every time I use R programming language not only am I not writing truly future compatible code, Iโm not practicing a skill that is beneficial for my future. Iโve read a lot of books on Python code and Iโve written a lot of Python but the way to be truly good at something is to use it a lot and practice. Itโs great to be a skilled R programmer but if Python is the future itโs what for naught. Yet, I constantly find when I write code in Python the weakness of the graphics, geospatial and even data wrangling capacities come back to bite my compared to what I can easily do in R no matter how much research I do into libraries and best practices. And that troubles me to keep going back to the second fiddle known as R programming.
With R 4.3.0 released on Friday, you can now use an โunderscoreโ with the built-in pipe, like you could use a โperiodโ in maggittr pipe. While there are still some reasons to use maggittr, like T-pipes, assignment pipes and exposition pipes, Iโve never used them and they arenโt exported by default in the tidyverse.
That was a major oversight when the created the native pipe, Iโm not sure why it wasnโt originally implemented when 4.0.0 came out but it wasnโt.
Also, you can use _$value to extract something from R: