Skip to content

Latest commit

 

History

History
124 lines (95 loc) · 7.46 KB

2024-02-08_EMEA-APAC.md

File metadata and controls

124 lines (95 loc) · 7.46 KB

Welcome to the R Contributor Office Hour (EMEA/APAC)!

2024-02-08

Useful links

Keeping in contact

Warm up

Please tell us a bit about yourself, following the template below:

Name: Heather Turner
Country I am currently in: UK
Something we could do or discuss together today: Bug 1161

Name: Tomasz Gieorgijewski
Country I am currently in: Poland
Something we could do or discuss together today:

Name: Ella Kaye
Country I am currently in: UK
Something we could do or discuss together today: I'm happy to give an update on the penguins/gait patch.

Name: Joakim
Country I am currently in: Turkey
Something we could do or discuss together today:

Name: Vaibhav
Country I am currently in: India
Something we could do or discuss together today:

Name: Munawar
Country I am currently in: UK
Something we could do or discuss together today: GSoC/GSoD

Name: Brian Terry
Country I am currently in: UK

Discussion

Update from Ella on adding penguins data

  • Is proposing to add palmerpenguins dataset to R. Patch adding the dataset is with an R Core member for review.

    • Has also prepared report to show this data may be used to reproduce some of the analysis from the orginal paper, as a way to validate the data

    • Take a look at Ella's patch: r-devel/r-svn#154. The GitHub mirror (github.com/r-devel/r-svn) of the of the official SVN repository (https://svn.r-project.org/R/trunk/) enables other people to review the patch and it is also possible to create a patch file from this which can be applied to the original Subversion repository by R Core (see https://contributor.r-project.org/rdevguide/FixBug.html#using-a-git-mirror).

    • Can use tools::checkRd to check the syntax of an Rd file.

  • Has been working on updating examples to use penguins data rather than iris

    • Some examples use iris3 which is an artificial reformatting of iris data as 3-way data set. So proposing to also add gait data as an alternative to this
  • Challenges.

  • Question: what is the difference between the GitHub Mirror and the Subversion repo?

    • The mirror can be a useful tool for contributors, especially when you want to share the code with other people for review. Patches created from the mirror include some git-specific text, but are compatible with SVN.
    • The actual sources are version controlled under SVN, so an svn-compatible patch must be created to propose a patch to R Core (this proposal is usually done via Bugzilla, see below).
    • Only R Core members can make commits to the SVN repo.
    • The GitHub mirror mostly shows mirrored commits by R core members, plus occasional commits by Jeroen Ooms, who maintains the GitHub mirror. There is some GitHub-specific code in the .github folder that implements the mirroring of the SVN repo.

Brief intro to bug tracking in R

Discussion of Bug 1161

  • Heather was set up with an RStudio project that had a local copy of her fork of the GitHub mirror, i.e. a local copy of https://github.com/hturner/r-svn. This meant we could look at her local copy of the R sources, in particular the source file for persp(), which is in src/library/graphics/R.

  • First we looked at the help file for persp, which says: "If x is a list, its components x$x and x$y are used for x and y, respectively.".

  • Then we tried to make a reproducible example, based on the first example in the help file. Original example:

    x <- seq(-10, 10, length.out = 30)
    y <- x
    f <- function(x, y) { r <- sqrt(x^2+y^2); 10 * sin(r)/r }
    z <- outer(x, y, f)
    op <- par(bg = "white")
    persp(x, y, z, theta = 30, phi = 30, expand = 0.5, col = "lightblue")
    

    with a list for x:

    persp(x = list(x = seq(-10, 10, length.out = 30), y = y), z = z,
          theta = 30, phi = 30, expand = 0.5, col = "lightblue")
    
  • We then looked at the source code persp() to try to understand what's happening:

    if (is.null(xlab))
       xlab <- if (!missing(x) && is.name(substitute(x))) deparse1(substitute(x)) else "X"
    

    How can we ever get to the else condition? Turns out we can drop x and the plot looks the same apart from having the x label "X"

    persp(y = y, z = z, theta = 30, phi = 30, expand = 0.5, col = "lightblue")
    

    presumably x defaults to sequence 1, 2, ...

  • At first we (Heather!) thought that the original poster (OP) objected to having an expression for an axis label rather than a name and we tried editing persp.default to only deparse x when it was a name. However we realized that an expression is also used as the label for the case when x is not a list. Also this behaviour is more general, e.g. plot() will also use an expression as the axis label by default.

  • After some discussion, and reviewing the bug report again, we realized that the issue was that it didn't make sense to label an axis (1 dimension) by a list of x and y (2 dimensions). It would make more sense to unpack the list, then continue as if x and y had been specified as separate arguments.

  • Heather also noted that it is possible to specify a list of x, y and z values, e.g.

persp(x = list(x = seq(-10, 10, length.out = 30), y = y, z = z),
     theta = 30, phi = 30, expand = 0.5, col = "lightblue")

This behaviour is undocumented.

  • Munawar volunteered to work on a fix following the idea to unpack the elements of the list somehow.
  • Heather mentioned the #work-out-loud channel on Slack, which can be used to discuss contributions people are working on, for feedback/help along the way.