|
| 1 | +# Welcome to the R Contributor Office Hour (EMEA/APAC)! |
| 2 | +2024-01-11 |
| 3 | + |
| 4 | +## Useful links |
| 5 | + |
| 6 | + * R Development Guide: https://contributor.r-project.org/rdevguide/ |
| 7 | + * R's Bugzilla: https://bugs.r-project.org |
| 8 | + * R Project Weblate server: https://translate.rx.studio/projects/r-project |
| 9 | + * R sources - SVN repo: https://svn.r-project.org/R/trunk/ |
| 10 | + * GitHub mirror: https://github.com/r-devel/r-svn/ |
| 11 | + * GitHub Codespace (R Dev Container) https://github.com/r-devel/r-dev-env |
| 12 | + * R-devel mailing list archives: https://stat.ethz.ch/pipermail/r-devel/, searchable GitHub repo: https://github.com/MichaelChirico/r-mailing-list-archive/tree/master/r-devel |
| 13 | + * Minutes from previous office hours: https://github.com/r-devel/rcontribution/tree/main/office_hours |
| 14 | + * Annotated list of bugs: https://docs.google.com/spreadsheets/d/1bhfPIJQXeKpydigMH79FKIkdHO9NxlBSB_bTRoCFnPY/edit#gid=0 |
| 15 | + |
| 16 | +## Keeping in contact |
| 17 | + |
| 18 | + * Twitter: https://twitter.com/R_Contributors |
| 19 | + * Mastodon: https://hachyderm.io/@R_Contributors |
| 20 | + * Slack: https://contributor.r-project.org/slack |
| 21 | + |
| 22 | +## Warm up |
| 23 | + |
| 24 | +Please tell us a bit about yourself, following the template below: |
| 25 | + |
| 26 | +Name: Heather Turner |
| 27 | +Country I am currently in: UK |
| 28 | +Something we could do or discuss together today: Bug 1161 |
| 29 | + |
| 30 | +Name: Tomasz Gieorgijewski |
| 31 | +Country I am currently in: Poland |
| 32 | +Something we could do or discuss together today: |
| 33 | + |
| 34 | +Name: Ella Kaye |
| 35 | +Country I am currently in: UK |
| 36 | +Something we could do or discuss together today: I'm happy to give an update on the penguins/gait patch. |
| 37 | + |
| 38 | +Name: Joakim |
| 39 | +Country I am currently in: Turkey |
| 40 | +Something we could do or discuss together today: |
| 41 | + |
| 42 | +Name: Vaibhav |
| 43 | +Country I am currently in: India |
| 44 | +Something we could do or discuss together today: |
| 45 | + |
| 46 | +Name: Munawar |
| 47 | +Country I am currently in: UK |
| 48 | +Something we could do or discuss together today: GSoC/GSoD |
| 49 | + |
| 50 | +Name: Brian Terry |
| 51 | +Country I am currently in: UK |
| 52 | + |
| 53 | +## Discussion |
| 54 | + |
| 55 | +### Update from Ella on adding penguins data |
| 56 | + |
| 57 | +- Is proposing to add palmerpenguins dataset to R. Patch adding the dataset is with an R Core member for review. |
| 58 | + |
| 59 | + - 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 |
| 60 | + |
| 61 | + - Take a look at Ella's patch: https://github.com/r-devel/r-svn/pull/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). |
| 62 | + |
| 63 | + - Can use `tools::checkRd` to check the syntax of an Rd file. |
| 64 | + |
| 65 | +- Has been working on updating examples to use penguins data rather than iris |
| 66 | + |
| 67 | + - 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 |
| 68 | + |
| 69 | +- Challenges. |
| 70 | + - Building R on the mac: working on documentation here: https://github.com/r-devel/rcwg/blob/main/working_documents/comments_on_install_r_macOS.md |
| 71 | + - R Core member who is reviewing this work wanted separate patches for the penguins and gait data. Unfortunately cannot make two forks of SVN mirror (github.com/r-svn), so worked locally for the gait data. |
| 72 | + |
| 73 | +- Question: what is the difference between the GitHub Mirror and the Subversion repo? |
| 74 | + - 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. |
| 75 | + - 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). |
| 76 | + - Only R Core members can make commits to the SVN repo. |
| 77 | + - 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. |
| 78 | + |
| 79 | +### Brief intro to bug tracking in R |
| 80 | + |
| 81 | +- Adding something new to R (as in Ella's patch) is something that contributors rarely work on - usually only R Core members do this. The more usual path for contributors is to work on bugs in R. |
| 82 | +- We looked at https://bugs.r-project.org and an example bug from the unofficial annotated bug list https://docs.google.com/spreadsheets/d/1bhfPIJQXeKpydigMH79FKIkdHO9NxlBSB_bTRoCFnPY/edit#gid=0. We saw that a patch (.diff) file can be added as a comment and people reading the bug report can view a visual diff in the browser. |
| 83 | +- Mentioned short video on contributor home page (https://contributor.r-project.org/) that gives some pointers on finding a bug to work on. |
| 84 | + |
| 85 | +### Discussion of Bug 1161 |
| 86 | + |
| 87 | +- 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`. |
| 88 | +- 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.". |
| 89 | +- Then we tried to make a reproducible example, based on the first example in the help file. Original example: |
| 90 | + |
| 91 | + ```{r} |
| 92 | + x <- seq(-10, 10, length.out = 30) |
| 93 | + y <- x |
| 94 | + f <- function(x, y) { r <- sqrt(x^2+y^2); 10 * sin(r)/r } |
| 95 | + z <- outer(x, y, f) |
| 96 | + op <- par(bg = "white") |
| 97 | + persp(x, y, z, theta = 30, phi = 30, expand = 0.5, col = "lightblue") |
| 98 | + ``` |
| 99 | + with a list for x: |
| 100 | + ```{r} |
| 101 | + persp(x = list(x = seq(-10, 10, length.out = 30), y = y), z = z, |
| 102 | + theta = 30, phi = 30, expand = 0.5, col = "lightblue") |
| 103 | + ``` |
| 104 | + - We then looked at the source code `persp()` to try to understand what's happening: |
| 105 | + ```{r} |
| 106 | + if (is.null(xlab)) |
| 107 | + xlab <- if (!missing(x) && is.name(substitute(x))) deparse1(substitute(x)) else "X" |
| 108 | + ``` |
| 109 | + 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" |
| 110 | + ```{r} |
| 111 | + persp(y = y, z = z, theta = 30, phi = 30, expand = 0.5, col = "lightblue") |
| 112 | + ``` |
| 113 | + presumably x defaults to sequence 1, 2, ... |
| 114 | + - 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. |
| 115 | + - 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. |
| 116 | + - Heather also noted that it is possible to specify a list of x, y and z values, e.g. |
| 117 | + ```{r} |
| 118 | + persp(x = list(x = seq(-10, 10, length.out = 30), y = y, z = z), |
| 119 | + theta = 30, phi = 30, expand = 0.5, col = "lightblue") |
| 120 | + ``` |
| 121 | + This behaviour is undocumented. |
| 122 | + - Munawar volunteered to work on a fix following the idea to unpack the elements of the list somehow. |
| 123 | + - 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. |
| 124 | + |
0 commit comments