Repository navigation
Description
@cbeleites I see that you inputted a great effort to create the hyperSpec package and its vignettes. I tried my best to translate the "plotting" vignette into Rmd. It took more time than I expected, some interpretation and corrections had to be added during the translation process so I need your opinion if you like the result.
Now I expect general remarks and comments. After that, I could create a pull request.
Principles
Some principles I used during translation from Rnw to Rmd:
- One row contains one sentence (i.e., no multi-line sentences). This makes it easier to track changes with the version control system.
- Package names in the text are written in bold (e.g.,
**hyperSpec**) - Package names in section headings are written in bold italics (
**_hyperSpec_**) (headings are usually in bold, do italics make package names distinguishable) - Functions are written between backticks (e.g., `...`{.r}) with parentheses (e.g., `fun()`{.r}). This allows functions to be highlighted differently than the surrounding text.
- Use either British or American English but not a mix of both. I used British English spellchecker during the translation process.
- In my opinion, R Code style is a bit inconsistent in hyperSpec. I used styler package with the "Tidyverse" rules for automatic code style corrections followed by manual corrections spotted out by RStudio code style diagnostic tools. NOTE. If these corrections are unacceptable in hyperSpec, the authors of the package should write an R code writing style guidelines and use the style consistently throughout the vignettes, examples and R script files. It would be better if (1) linting (i.e., code style checking) rules are created for automatic checking (e.g., see package lintr and (2) if styler rules are created for doing automatic corrections (e.g., the authors of mlr package implemented their own rules).
- Floating images are not directly supported by Rmd. For HTML vignettes tried simple CSS to make the images floating but the result was ugly. So instead, what was a floating image in Sweave, became a subsection in Rmd. Due to this fact, I added additional sentences to make a more fluent expression of ideas.
- I added captions to each figure. The authors of the package may want to change or correct those.
- All figures are automatically numbered.
- Inside the main text, references to each figure were added.
- Some helper functions were taken from "vignette.defs" and redefined so that their results would match Rmd syntax.
- For session information, I suggest using
sessioninfo::session_info().
TODOs:
- I'm not sure if "vignette.defs" file should be mentioned in vignettes. In my opinion, all the codes needed to reproduce the examples must be contained inside the vignettes. Additionally, sourced files should only contain functions that help vignette creators to write less code and end-users are not interested in these functions.
- English grammar and writing style should be reviewed. Some grammatical errors may be introduced during the translation and they might be unspotted by spell/grammar checker (I used free edition of Grammarly).
The affiliations are not visible in HTML vignette yet.Email also looks strange/not beautiful. So this is work to do.- Some tweaking for lattice parameters should be made as the x-axis labels are not fully visible.
- Rmd file contains FIXME and TODO tags with more specific comments.
In the future, I think, some examples related to latex2exp::TeX() (to write formatted labels more easily) and plotly::ggplotly() (to make interactive plots from spectra created with ggplot2) could be added. It might be possible to create a bookdown book instead of/in addition to the vignettes, that are translated to Rmd.
Related: #79
Activity
GegznaV commentedon Dec 31, 2019
Updated version of the files: plotting.zip
GegznaV commentedon Jan 2, 2020
It is better to review the translated vignettes in pull request #94
cbeleites commentedon Jan 14, 2020
Many thanks for the great and thoughtful work.
I'd like to pull suggestions a bit apart in order to put this and also #78 into the larger context of overhauling hyperSpec for milestone "hyperSpec 1.0".
Here are my general thoughts:
With this, we may be able to get rid of the as.is-vignettes and get to a more normal package structure. (One step further would/will be to separate some functionality into own packages, e.g. file import, ggplot and ggplotly support, also matrixstats.).
Now the more specific points:
vignette.defsquite a lot of the code in there is not needed any more (e.g. everything related to prepare citation lists). I think we can and should go without for the Rmd vignettes.plotmat()and maybe alsoplotmap()discussion.[-]Review the vingnette translated to Rmd: "plotting"[/-][+]Review the vignette translated to Rmd: "plotting"[/+]GegznaV commentedon Jul 12, 2021
I'm closing this old discussion.