Skip to content

Review the vignette translated to Rmd: "plotting" #93

Closed

Description

@GegznaV

@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:

  1. One row contains one sentence (i.e., no multi-line sentences). This makes it easier to track changes with the version control system.
  2. Package names in the text are written in bold (e.g., **hyperSpec**)
  3. Package names in section headings are written in bold italics (**_hyperSpec_**) (headings are usually in bold, do italics make package names distinguishable)
  4. 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.
  5. Use either British or American English but not a mix of both. I used British English spellchecker during the translation process.
  6. 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).
  7. 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.
  8. I added captions to each figure. The authors of the package may want to change or correct those.
  9. All figures are automatically numbered.
  10. Inside the main text, references to each figure were added.
  11. Some helper functions were taken from "vignette.defs" and redefined so that their results would match Rmd syntax.
  12. For session information, I suggest using sessioninfo::session_info().

TODOs:

  1. 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.
  2. 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).
  3. The affiliations are not visible in HTML vignette yet. Email also looks strange/not beautiful. So this is work to do.
  4. Some tweaking for lattice parameters should be made as the x-axis labels are not fully visible.
  5. 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

  1. GegznaV commented on Dec 31, 2019

    @GegznaV
    CollaboratorAuthor

    Updated version of the files: plotting.zip

  2. GegznaV commented on Jan 2, 2020

    @GegznaV
    CollaboratorAuthor

    It is better to review the translated vignettes in pull request #94

  3. cbeleites commented on Jan 14, 2020

    @cbeleites
    Owner

    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:

    • yes we need consistent code style => issue Consistent code style #96
    • I think your "principles" should become a style-guide document for hyperSpec's vignettes.
    • With pkgdown, we can have articles that do not appear as vignettes.

    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.).

    • bookdown documentation: definitively also something to keep in mind

    Now the more specific points:

    1. +1
    2. +1
    3. +1
    4. +1
    5. +1 - AE or BE is the same to me, but you are right that we should agree.
    6. inline figures instead of float => I used floats because that's nicely done by LaTeX, no deeper thoughts behind this. On screen, they are IMHO less useful.
    7. captions => I'm open for opinions.
    8. +1
    9. +1
    10. vignette.defs quite 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.
    11. +1
    • We should maybe also decide on lattice style. I'd nowadays prefer e.g. viridis colors for the plotmat() and maybe also plotmap() discussion.
  4. changed the title [-]Review the vingnette translated to Rmd: "plotting"[/-] [+]Review the vignette translated to Rmd: "plotting"[/+] on Feb 7, 2020
  5. added
    Topic: documentation 📘
    Topic: vignette 📗
    on May 25, 2020
  6. added
    Topic: plots 📈
    on Jun 11, 2020
  7. added
    Topic: style ✏️
    and removed
    Topic: documentation 📘
    on Jul 24, 2020
  8. GegznaV commented on Jul 12, 2021

    @GegznaV
    CollaboratorAuthor

    I'm closing this old discussion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Note: guidelineTopic: plots 📈Topic: style ✏️Topic: vignette 📗

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions