R remains my secret weapon 🖥️

For so much I do every day at work, for Save the Pine Bush and for the blog, R remains the tool I use most. R with the tidyverse packages along a few other – namely sf, tigris, tidycensus provide many excellent tools, when tied together with pipes to build amazing data streams.

I think what I like so much about R is it’s an interpretive language at it’s core and the ability to chain commands together with maggitr pipes. You can try something, one line at a time in R, without recompiling, inspect the output, adjust it, and then when you are ready, assign it to a variable. The tidyverse provides several utilities for manipulating data frames, and with tigris and sf, you have the ability to preform all kinds of spatial queries on the data. R makes it easy to do something like pull every record that is within 30 miles of a specific point – or falls in a Census tract where the median income is under $50,000.

So much of what I do at work, for fun or as a volunteer involves joining records together. While such things can be done with SQL and similar languages, there is something so simple and beautiful about the tidyverse, chaining long lists of commands together, keeping each step of the process separate. SQL instead forces you to put everything in one line, and know what you are doing, before you start writing out the command.

As a cherry on the pie, R has the wonderful option of a right-handed assignment. Often when I am writing a command, I am not sure when I want to assign the output to the variable until most of the command is written out. With Python and most other langagues you have to always preform the assignment on the left, which can be hard to do, if you don’t know when you finally want to assign the output variable. Often

Map: Alma Pond
Map: Dobbins Memorial State Forest
Map: Little John Wildlife Management Area
Map: Otter Lake
Map: South Hill State Forest (Oneida 23)
Map: Summer Hill State Forest
Map: West Parishville State Forest
SVGZ Graphic: albany-snow-depth
SVGZ Graphic: college-rate
SVGZ Graphic: december-holidays
SVGZ Graphic: ht2025
SVGZ Graphic: lt2025
SVGZ Graphic: Places Named Bethlehem
SVGZ Graphic: Towns with Most Similiar Land Cover to the Town of Bethlehem
Terrain Map: Happy World Milk Day!
Photo: Looking Down at Albany from Wolf Hill
Photo: Albany From Windham High Peak
Photo: Junk by Old Ranger's Garage
Photo: This is a reflection
Photo: Fountain
Photo: Evening sky
Photo: Camping on Forest Road 13
Photo: South Towards Montour Falls
Photo: Toes
Photo: Ducks

Leave a Reply

Your email address will not be published. Required fields are marked *