Learned that the string GITHUB_PAT can be found in the .github/workflows directory.
Learned about documentation managers. There’s: Zeal and DevDocs.
Learned that there are, like, eight test suites. And they automatically run when you make a pull request to the animint2 repository. That’s nice. I’m also learning that the tests take a long time to run—about 45 minutes.
Turns out that ripgrep-all doesn’t look through YAML files. I need something like yq instead. Why?
Created
Created README.md from the README.org file via the magic of pandoc.
Created a preliminary website and documented how I generated it:
For the documentation and code, see website_setup.Rmd. Currently have information about building the website.
Put the site up online.
Accidentally made a pull request in tdhock/animint2. Should’ve been ampurr/animint2 instead. I closed it—be more careful.
Made a pull request in ampurr/animint2 but did not initially succeed in closing it due to a test failing. Later, I pushed it anyway, which then threw the website online.
Successfully set up the website. But there are some errors. Most noticeably: it includes some functions that don’t seem to be part of animint2. Will need to investigate further.
Confused
One of the tests—“Test Suite compiler”—failed. Here’s the error message:
Code
══ Failed tests ════════════════════════════════════════════════════════════════── Error ('test-compiler-gist.R:4:3'):animint2gist() returns an object of class 'gist' ──Error: Error: In non-interactive environments, please set GITHUB_PAT env to a GitHub access token (https://help.github.com/articles/creating-an-access-token-for-command-line-use)Backtrace: ▆1. └─animint2::animint2gist(list(p =qplot(1:10)), browse =FALSE) at test-compiler-gist.R:4:22. └─gistr::gist_create(...)3. ├─gistr:::gist_POST(...)4. │ └─gistr:::cVERB(...)5. │ └─crul::HttpClient$new(url, headers =c(auth, headers), opts =list(...))6. │ └─crul (local) initialize(...)7. └─gistr::gist_auth()[ FAIL 1| WARN 0| SKIP 5| PASS 756 ]Error: Error: Test failuresExecution haltedError: Process completed with exit code 1.
This is confusing, since I thought GITHUB_PAT was already set with a GitHub Access Token. I was also unaware of the large array of tests that activate when you try to push something. Quite frankly, I’m not sure what they do or what they prevent. It feels different than using testthat.
I also don’t understand the GitHub workflow stuff. What exactly is GitHub doing?
Week 2
This week (June 5 to June 11), I tried to fix issue 89. I did not succeed.
Learned
Learned that the roxygen2 package generates both the .Rd files and part of the DESCRIPTION for packages.
Learned about RFC 2822, a syntax standard for text messages in email. FastMail mentions that RFC 5322 makes RFC 2822 obsolete, but Writing requests emails be written in RFC 2822 formatting.
When using Git Bash—i.e. MinGW—and cd, I need to swap the backwards slashes for forward slashes. Oddly, the backwards slashes work for some directories but not for others. It took me a while to realize this while debugging.
Figured out that the borders() function is part of fortify-map.r. That’s why it disappeared when I deleted that R file.
Learning about bash.
Learned that all the tidyverse data tidiers will eventually be retired. This includes both ggplot2::fortify() and broom::tidy().
Created
Nothing of value. I created several branches to try and fix the issue and didn’t succeed.
One branch focused on removing the fortify functions in animint2. This caused several tests to fail. Later, Toby told me that map_data is used in several tests and relies on the fortify functions.
As part of a debugging process, one branch was a copy of the main branch with an additional text document. It was meant to test the GitHub tests. It passed the tests.
Another branch was meant to debug the branch where I removed the fortify functions.
Failed
My debugging process didn’t succeed. Or, at the very least, it didn’t succeed in time.
Parts of it were headed in the right direction. After some experimentation, I confirmed that the problem stemmed from my changes to the repository (the removal of the fortify functions) and not from either build.sh or the GitHub tests. But my debugging was focused on the following error message:
Error in FUN(X[[i]], ...): numeric ‘envir’ arg not of length one.
This error message comes from the ggplot2 side of animint2’s code. In some sense, I was looking in the right direction—the fortify functions are from the ggplot2 side of things. But I was focused on figuring out substitutes for fortify and failed to notice that the problem was with map_data.
Confused
For some reason, build.sh always fails to generate the \(\LaTeX\) document correctly, mentioning some problem with the .Rd files. Then I think it runs the process again, and the problem disappears. Why?
Why are the tidyverse data tidiers being retired? I can’t find any info about that.
yay -S r-plyr r-reshape2 isn’t working and requires “manual intervention.” Why? Luckily, this isn’t important—build.sh runs perfectly fine on Git Bash and therefore I don’t actually need to figure out why the yay helper is acting this way.
Week 3
This week (June 12 to June 18), I complained a lot. I chatted with Fei, who said that she would take care of issue 90. Thank you, Fei!
Learned
First meeting with Toby!
animint2 doesn’t compute—all computations are done beforehand, and then animint2 displays that as an interactive data visualization.
Also learned that capital letters go before lowercase letters in terms of alphabetical order. At least according to R.
build.sh, and some of the GitHub Actions, are meant to emulate CRAN checks.
All else being equal, prefer small changes over large changes.
Made a comment in issue 90. Fei fixed Big Bug, but Little Bug is left.
Made a new issue: issue 96, which is about some \(\LaTeX\) errors that seem exclusive to me.
Week 4
This week (June 19 to June 25), I tried to set up the reference website again—this time in Toby’s repository instead of my fork. This didn’t work, so I started tinkering with my fork again.
Looked up how to get permission to change GitHub Page settings in the animint2 repository. One Stack Overflow post suggested obtaining admin rights. Instead, Toby created an organization for repository and gave us permissions that way.
You can choose which GitHub Actions to re-run. Nice! When a test fails, I can just rerun that test instead of waiting 45 minutes for everything to run again.
There’s an error that I often get: In non-interactive environments, please set GITHUB_PAT env to a GitHub access token. Where does it come from? After doing a GitHub code search, I figured out that it’s from the gistr R package.
Created
A mess. I accidentally merged my changes from my fork of animint2 into the original animint2 repository. Whoops.
You know issue 96? The one about \(\LaTeX\) errors? I tried installing Inconsolata, but it didn’t fix the issue. My Inconsolata font is the variable one from Google Fonts.
I wanted to know if it was possible to manually run a GitHub Action thing—that way, I would know if I’m failing a test before I submit a pull request. Turns out the answer is yes, but only if I have the workflow_dispatch trigger. The workflow in animint2 doesn’t have that trigger, though.
Toby created an organization, animint, for the animint2 repository. I did some things with it:
I changed the profile picture to a dittered Suki. Improving the world one cat pic at a time.
I changed the settings so that we can control things with our personal access tokens (PATs). If you want, go to Settings > Third-party Access > Personal Access Tokens to change it back.
I generated a PAT for animint2.
Converted README.md to README.qmd, which will let me do R computations for the website homepage.
Added the “Differences with other packages” section from README.org to the animint2 repo wiki.
In Progress
I’m thoroughly updating and cleaning up the website_setup.Rmd document.
I’m editing README.qmd to be clearer and more immediately useful. Later, I’ll convert it to README.md for pkgdown to read.
Week 6
Hoping to finish up the website this week (July 3 to July 9).1 Weird bugs exclusive to me and GitHub-specific problems… I’m behind on my timeline for reasons I didn’t anticipate. Good learning experience, though I’m learning about things I didn’t anticipated.
Use [link](#foo-bar) to link to the foo-bar section in a Markdown document. Link.
Created
Massaged simulated data until they were useful and looked somewhat real.
Continued work with simple-examples.Rmd, which was renamed quick-start.Rmd. The simple examples vignette has transformed into a larger quick start guide.
Week 8
This week (July 17 to July 23), I finally finished the quick start guide. And the README, too. I also worked a little on website_setup.Rmd and _pkgdown.yml.
Learned
Erik Bernhardsson has an analysis for why software projects take longer than expected. For obvious reasons, it’s something I’ve been thinking about regarding the reference website project.
Learned (or re-learned) about the signif() function, which is useful for rounding and cutting off overly-precise numbers.
Data Visualization: A Practical Introduction has a section on broom in Chapter 6. Useful, since it’s unclear to me what data tidiers do.
I’d forgotten why _pkgdown.yml uses bootstrap: 5. It’s cuz some sites might break from the upgrade, so we need to specify that we wanna use Bootstrap 5.
Created
Finished the pkgdown.yml draft.
There was a parser error, but I fixed it. Turns out it was a whitespace error.
There’s an odd warning message when you build or check the site with pkgdown: incomplete final line found on './_pkgdown.yml'. There’s a bug report about it. It’s a YAML thing, but I’m not sure why.
Just gonna ignore it for now.
Created
Finished pkgdown.yml! Woot woot!
Reorganized all the topics.
Wrote up descriptions for the titles.
Week 11
This week (August 7 to August 13), I put a mostly-finished website online! Woot woot!
Learned
Fun with git:
.gitignore comments use #. Just like R and YAML.
You need to merge all files before you can revert anything.
Notepad++ stopped working. Removing the plugins folder resolved the issue, though it causes other problems. Probably something wrong with one of the plugins.
It’s about how some of the datasets lack either a source (2) or a codebook (19). Or both (19).
Added a bunch of TODOs in the .Rd files in man/.
Added a todo.md file briefly explaining the TODO nomenclature.
Other Notes
There seems to be a minor accessibility bug with pkgdown. When you use ![alt text](source) and render it as an HTML file, it takes the alt text and renders it twice: as the alt text and also as the figure caption.
Week 12
This week (August 14 to August 20), I worked on improving the website, mostly with CSS.
Learned
I was previously unaware of CSS’s letter-spacing property.
Resources that I’ve looked at to try and solve the JavaScript problem of animints not appearing in the quick guide. I should note that looking into this problem has been somewhat confusing.
Toby told me to look at the z_knitr.R file, just in case it’s something on our end.
This 2021 pkgdown issue mentions something about live graphs no longer working. But that issue has been fixed, hasn’t it?
There’s an R package called htmlwidgets. Seems cool.
There were a lot of resources I consulted when designing the code annotations.
Remember: use element#id when selecting IDs.
Controlling the gap between the list marker and whatever’s after it is a real pain in the rear. See this CSS Tricks link for an analysis of this problem. See this link or this link on what to do. I just used <span> a bunch of times and then moved those. Thoroughly inelegant, but it works.
Finally got the animints working in the quick start guide! I’ve moved the guide to its own section on the navigation bar.
Some other website changes:
Switched the font from system-ui to Roboto Condensed and Roboto Mono.
Changed the link color to match the link color on Toby’s website.
Increased spacing between each heading.
Generated code annotations from code comments cuz I don’t have direct access to the HTML. This was hard!
Confused
Okay. Debugging notes. The problem is that the website won’t render our animints. This seems to be the result of two issues:
pkgdown renders the animints in the vignettes/ directory instead of docs/articles/.
Having the animints in docs/articles/ doesn’t appear to do anything.
My guess is that it’s a pkgdown thing. Quarto renders it, so the origin of the problem’s not animint2. The animint2 Manual renders it, too. So it’s not anything to do with R Markdown.
The JavaScript output looks the same as well. It’s a bunch of <script type="text/javascript" src="animint/directories"> for the first codeblock, followed by <script>var chunk_name = new animint("#chunk_name", "chunk_name/plot.json");</script> for any future codeblocks. So there’s nothing wrong with the code being generated.
Maybe the code needs to be generated in the docs/ directory instead of vignettes/? But why? I used fc.exe to look at the files and obviously there’s no difference between them.
Oddly, the bug fixed itself. I just renamed the file and now the animints work. Bizarre.
R Markdown does give some control over alt text and captions. You can use {r fig-alt: "foobar"}. Link. Other link. But this obviously doesn’t work for images not generated by a code chunk. It also doesn’t work for animints.
I looked into browser detection so it’d only show for Firefox users. CSS Tricks link. But I learned that this feature is brittle and generally a bad idea.