Skip to content

Instantly share code, notes, and snippets.

Avatar

Michael Sumner mdsumner

View GitHub Profile
View lovely_R_eastereggs.md

here's the content of a SO deletion by a sanctimonius obstructionist.

I think I've seen an Easter egg or two in some R packages, but I am not able to recall them.

Here are a few from Matlab, and more here, if you want to see some examples of Easter eggs.

Are there any known Easter eggs in R or some of the major packages?

(If justification is really necessary...the reason for asking is simple: some of the Easter eggs for Matlab demonstrate useful functionality and happen to be amusing. I'm not particularly enamored with their "default image" Easter egg, but the examples for simulations (e.g. life and toilet) are actually useful for code and pedagogical purposes. Not all demos need to be dry.)
View fortherecord.md

block this guy, cpp11 is not called tidyCpp because this one did a CRAN package name land-grab

image

image

View cran_snafu.md

Having clarity on what checks will occur and access to the infrastructure to do so - at least recipes to build the machine/s. The submission frontend is very open and happy, "Please fix and resubmit" and very encouraging - and includes automated checks and feedback, and doesn't seem to care much about mistakes and submission churn. But the backend is totally opaque, and despite some promise (rhub, docker, gh actions etc etc) no clear way exists to reproduce the check problems seen (unless you are maybe a total guru of R core godlike status with system admin). The feedback you get is "not fixed, archived again" - silently posted on CRAN, and outside of defined communication protocols (i.e. no email).

The one big thing to reduce friction IMO: leverage the rOpenSci universe to host the checks. If the current maintainer/s simply refuse to open the vaults and help define, curate and maintain accessible check machines, let's be explicit about that and provide clarity about where this very real problem lies. Wh

View kerchunk_setup.md

System deps (not comprehensive I'm on ubuntu with the usual gdal,proj,netcdf,python stuff).

python3 -m pip  install xarray intake s3fs zstandard intake-xarray

What's wrong!? Blog post says no credentials needed ...

View flipflip.md
View gdawarp_grid.md

First, a simple pass with R helpers.

  ## packages from github.com/hypertidy dep on CRAN {vapour}
library(whatarelief)
library(ximage)
f <- normalizePath("~/20220902T00Z_MSC_HRDPS_HGT_SFC_RLatLon0.0225_P001.grib2")

ex <- c(-180, 180, -90, 90)
dat &lt;- elevation(source = f, extent = ex)
View AMSR2_netcdf_projection_ignorance.md
vapour::vapour_raster_info(tf)
$geotransform
NULL

$dimension
[1] 512 512

$dimXY
[1] 512 512
View HBV_netcdf.md

get HBV and open with terra

wget http://www.gloh2o.org/data/HBV_parameter_maps_V0.9.zip  
unzip HBV_parameter_maps_V0.9.zip 

then in R

View foieGras_antimeridian.md
library(sf); sf_use_s2(FALSE)
#> Linking to GEOS 3.10.2, GDAL 3.4.3, PROJ 8.2.0; sf_use_s2() is TRUE
#> WARNING: different compile-time and runtime versions for GEOS found:
#> Linked against: 3.10.2-CAPI-1.16.0 compiled against: 3.10.1-CAPI-1.16.0
#> It is probably a good idea to reinstall sf, and maybe rgeos and rgdal too
#> Spherical geometry (s2) switched off
library(foieGras)
#> Warning in checkTMBPackageVersion(): Package version inconsistency detected.
#> foieGras was built with TMB version 1.8.1
View nat_earth_raster.md