Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible bug with r-basics-with-tabular-data.md #2413

Merged
merged 15 commits into from Dec 2, 2021

Conversation

drjwbaker
Copy link
Member

@drjwbaker drjwbaker commented Nov 29, 2021

I think this is wrong. For me l60..

Take a look at the AirPassengers data set by typing data(AirPassengers) into the console

..doesn't work. What does work is just typing AirPassengers. Can you check this please @anisa-hawes before merging? (as it may just be my setup!)

Checklist

  • Assign yourself in the "Assignees" menu
  • Assign at least one individual or team to "Reviewers"
    • if the text needs to be translated, assign the relevant language team(s) as "Reviewers" and tag both the team as well as the managing edtor in your PR. Please follow the translation request guidelines when writing your PR description
  • Add the appropriate "Label"
  • Ensure the status checks pass
  • Check the live preview of your PR on Netlify
  • If this PR closes an open issue, add the phrase Closes #ISSUENUMBER to the description above

If you are having difficulty fixing build errors, first consult https://github.com/programminghistorian/jekyll/wiki/Making-Technical-Contributions carefully, especially "Common Build Errors". Then contact the technical team if you need further help.

I think this is wrong. For me l60..

> Take a look at the `AirPassengers` data set by typing `data(AirPassengers)` into the console

..doesn't work. What does work is just typing `AirPassengers`. Can you check this please @anisa-hawes before merging? (as it may just be my setup!)
@DanielAlvesLABDH
Copy link
Contributor

Olá @JimmyMedeiros82, nós traduzimos esta lição há pouco tempo. Será que temos o mesmo bug ou foi corrigido na tradução? Abraço

@anisa-hawes
Copy link
Contributor

Thank you @drjwbaker! I will test it today, and will also fix the broken link which is causing the build to fail!

@anisa-hawes
Copy link
Contributor

anisa-hawes commented Dec 1, 2021

Thank you for noticing this error, @drjwbaker! I have tested this on my set up (I work on macOS BigSur v11.5.2) and found that the same was true. The command data(AirPassengers) didn't load the data set into my console. But, as you suggested, simply typing AirPassengers did!

Screenshot 2021-12-01 at 11 59 01

I can update this on EN, ES and PT.

Also: the link https://joedicastro.com/pages/markdown.html actually appears to be live. Perhaps the site was temporarily down when this build check ran...

@anisa-hawes
Copy link
Contributor

anisa-hawes commented Dec 1, 2021

Re-reading this, it seems to me that the whole paragraph is quite confusing. The sentences "Enter data(AirPassengers) into the console and hit Enter. On the next line, type in AirPassengers and hit Enter again" are redundant, effectively repeating the same instruction...

My suggestion is that this would be clearer:

Take a look at the AirPassengers data set. To load the data set into your console, type AirPassengers and hit Enter. This will bring up a table showing the number of passengers who flew on international airlines between January 1949 and December 1960, in thousands. You should see:

I'll also update the code blocks, so that the commands shown match those instructed in the lesson text.

anisa-hawes and others added 4 commits December 1, 2021 12:07
Updating para.60, to replace the command `data(AirPassengers)` with ` AirPassengers` and clarify the instruction.
Also, updating the code block, lines 63-4.
Clarifying the instruction para.63.
Updating the code block, lines 66-7.
Updating para.66, to replace the command `data(AirPassengers)` with `AirPassengers` and clarify the instruction.
Also, updating the code block, lines 69-70.
Update the paragraph to eliminate the repetition in Portuguese
@rivaquiroga
Copy link
Member

Hi everyone!
This is not really a bug. Both commands do different things.
data(AirPassengers) makes this built-in dataset available in your Global Environment. Running AirPassengers will only print it to the console. Doing the first step is not a requirement for the second one, BUT after loading a dataset with data() you will be able to see it in the Environment pane. Sometimes this is useful when teaching, especially if you are using an IDE like RStudio, because students can see the dataset as an object/variable.

If you only print the object by calling it by its name, your RStudio session will look like this:

Captura de pantalla de 2021-12-01 09-54-44

If you run data(AirPassengers), the dataset is loaded in your environment as a value

Captura de pantalla de 2021-12-01 09-54-23

If you print it with AirPassengers after that, you will also see information about the dataset in the environment. This will not happen if you skip the data(AirPassengers) step.

Captura de pantalla de 2021-12-01 09-57-31

Because the lesson is only using the R Console, it looks like data(AirPassengers) is not doing anything, but it is.

This part of the lesson is a little confusing, because that command is not loading the dataset into the console, but into the global environment: "Take a look at the AirPassengers data set by typing data(AirPassengers) into the console. This will load the data set into the console.".
If you decide to remove the data(AirPassengers) step, I would suggest using the word_print_ and not load to refer to what happens when you just type AirPassengers.

@drjwbaker
Copy link
Member Author

Thanks for your comments @rivaquiroga: shows how much I know about the R console! (not much).

If you decide to remove the data(AirPassengers) step, I would suggest using the word_print_ and not load to refer to what happens when you just type AirPassengers.

That makes the most sense to me as the data(AirPassengers) step appears redundant given how the lesson is written.

@jenniferisasi
Copy link
Contributor

@rivaquiroga, who knows more R than I do, bit me to explain the "issue". Or misunderstanding of the function data() (loading) vs printing the dataset.

Additionally, @anisa-hawes remember in my workshop I said you can Command-click on the dataset and it will open a spreadsheet-like view? This is why :)

Re-reading the paragraph in my translation, I think it is clear but it's a bit messy so I would be happy to update it and explain it better

Updating para.60
Updating code block, line 64
@anisa-hawes
Copy link
Contributor

Thank you @rivaquiroga and @jenniferisasi!

Taking what you have explained into account, I wonder if the following adjustment I've made to the EN wording might make best sense:

First, you need to load the AirPassengers data set into your console. Type data(AirPassengers) and hit Enter[^1]. To view the data set, type in AirPassengers on the next line and hit Enter again. This will print a table showing the number of passengers who flew on international airlines between January 1949 and December 1960, in thousands. You should see:

data()
data(AirPassengers)
AirPassengers

@anisa-hawes
Copy link
Contributor

That makes the most sense to me as the data(AirPassengers) step appears redundant given how the lesson is written.

Ah... Let me know what you think is best, @drjwbaker.

@drjwbaker
Copy link
Member Author

No no, go with what @rivaquiroga and @jenniferisasi say: they are the experts here, I hardly ever use rconsole. It feels like the article is using best practice for a reason, just hasn't quite explained why.

@rivaquiroga
Copy link
Member

@anisa-hawes I would suggest for the first sentence: "First, you need to load the AirPassengers data set into your R session"

Adjust first sentence of para.60
Update code block, line 67

```
> data()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can remove this extra data(), as it is mention in the previous paragraph just as an example of how to take a look to all the available datasets. It is not really a step expected for users to do for what comes next

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, okay. I'll remove this!

Remove `> data()`, line 63
Remove `> data()`, line 66
@anisa-hawes
Copy link
Contributor

Hello @JimmyMedeiros82 and @DanielAlvesLABDH. Might either of you have a moment to review paragraph 60 of nocoes-basicas-R-dados-tabulares.md, to ensure that the instructions are clear about what each command achieves?

data(AirPassengers) loads the data set into the R session
AirPassengers prints the data set

The adjusted EN text is:

First, you need to load the AirPassengers data set into your R session. Type data(AirPassengers) and hit Enter[^1]. To view the data set, type in AirPassengers on the next line and hit Enter again. This will print a table showing the number of passengers who flew on international airlines between January 1949 and December 1960, in thousands. You should see:

@anisa-hawes
Copy link
Contributor

Thank you, @DanielAlvesLABDH!

Let us know if you have time to check the ES for clarity, @jenniferisasi or @rivaquiroga? When you're happy, I'll merge these changes.

@jenniferisasi
Copy link
Contributor

I'll do it! Give me a sec...

@anisa-hawes
Copy link
Contributor

Thank you, all!

There's a broken link now, so I will fix this.

@anisa-hawes
Copy link
Contributor

Hmmm.... link seems to be correct & live....
https://github.com/impresso/PH-passim-tutorial/blob/master/explore-passim-output.ipynb
Will re-run...

@anisa-hawes anisa-hawes merged commit 25869f8 into gh-pages Dec 2, 2021
@acrymble acrymble deleted the drjwbaker_2021-11-29_R-patch branch February 24, 2022 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants