Tag: r

  • Non-unique species names

    If you’re given a species name of the form genus + specific epithet, does it uniquely identify a particular species level taxon? Nope. In R, playing again with taxa.csv from https://www.inaturalist.org/taxa/inaturalist-taxonomy.dwca.zip, provided by iNaturalist: (This reminded me of an old conversation I had on r-sig-mac: https://stat.ethz.ch/pipermail/r-sig-mac/2008-September/005304.html.) Extracting the non-unique species: Here’s a spreadsheet with the…

  • Percent of Iowans in county with OB Unit

    Following up on my previous post, Obstetrical care in Iowa, I was curious what percentage of Iowans are in a county with an OB Unit. We can get this pretty easily using the handy usdata R package in combination with the data we extracted previously. With this preamble, now we can take a weighted mean…

  • Obstetrical care in Iowa

    The third article in Kalen McCain’s excellent series on maternal healthcare in southeastern Iowa, Barriers aren’t limited to birthdays, features a map from numbered page 14 of ACCESS TO OBSTETRICAL CARE IN IOWA: A REPORT to the IOWA STATE LEGISLATURE – CALENDAR YEAR 2021 [PDF]. This got me wondering what it would take to reproduce…

  • Iowa county seats

    I got the coordinates of the county seats using the utility I previously wrote to get California county seats: The generated CSV is now available here: https://github.com/fadend/county_seat_coords/blob/main/county_seat_coords/generated/ia_usa_county_seats.csv. One complication that it doesn’t handle: Lee County has *two* county seats. A little copying pasting from the R code from the other post produced a pretty okay…

  • Stripping NULLs recursively from an R list

    Is there a nicer way to do this in R? I have a list where some elements are themselves lists (of lists of lists, etc.) I want to ignore entries with NULL as well as entries that are empty after stripping NULLs.

  • California County Seats

    I had some fun today getting the location of each county seat in California. You can see the code here if you’re curious: https://github.com/fadend/county_seat_coords. The data are pulled from Wikipedia’s List of counties in California. I plotted them going through the tutorial here: https://eriqande.github.io/rep-res-eeb-2017/map-making-in-R.html. (Very nice!) Here’s my ugly R code for doing that, shamelessly…

  • Peer bonuses

    One thing I really liked about Google is its peer bonus system. What other companies have something similar? Laszlo Bock describes Google’s system in his book Work Rules: The other feature of gThanks is the peer bonus… Giving employees the freedom to recognize one another is important. Many companies allow employees to nominate an employee…