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

Improve p2 #27

Merged
merged 2 commits into from
Oct 30, 2024
Merged

Improve p2 #27

merged 2 commits into from
Oct 30, 2024

Conversation

yyuanxuan
Copy link
Collaborator

No description provided.

Use tab panels for R and Python codes
Copy link
Member

@Robinlovelace Robinlovelace left a comment

Choose a reason for hiding this comment

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

This looks way better, many thanks @yyuanxuan I just made a couple of minor comments, let's see how it looks on the website.

@@ -32,27 +33,28 @@ Install the packages by typing in the following commands into RStudio (you do no

If you need to install any of these packages use:

::: {.panel-tabset group="language"}
::: {.panel-tabset}
Copy link
Member

Choose a reason for hiding this comment

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

Why not 'language'?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

When this option is set, clicking on the Python tab will switch all code blocks to Python. However, due to the different lengths of the R and Python code blocks, this causes the content within the current browser window to suddenly jump, creating significant interference with reading. You have to scroll up or down to find the section you were just reading. Students using Python still need to compare the results of the R code execution, so such page jumps and interruptions can happen frequently. Removing the language grouping can avoid this problem, as each code block switch would only apply to the current tab, resulting in less disruption to the reading experience - in my opinion, this has a better user experience.

Copy link
Member

Choose a reason for hiding this comment

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

OK, great explanation, thanks!

#| eval: false
if (!require("pak")) install.packages("pak")
pak::pkg_install(c("sf", "tidyverse", "remotes"))
# GitHub pkgs
pak::pkg_install("Nowosad/spDataLarge")
```

```{r}
``` {r}
Copy link
Member

Choose a reason for hiding this comment

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

Why the gap here?

library(sf) # vector data package
library(tidyverse) # tidyverse packages
library(spData) # spatial data package
```

## Python

```{python, eval=FALSE}
``` {python}
Copy link
Member

Choose a reason for hiding this comment

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

👍

Copy link
Member

Choose a reason for hiding this comment

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

But without the space I think is better:

Suggested change
``` {python}
```{python}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for pointing these out. I will fix them in the future— the added space was by mistake and not intentional.

@Robinlovelace Robinlovelace merged commit 9f235e8 into main Oct 30, 2024
1 check passed
@Robinlovelace Robinlovelace deleted the improve-p2 branch October 30, 2024 17:14
Robinlovelace pushed a commit that referenced this pull request Oct 31, 2024
* change one line in README.qmd

* improve p2

Use tab panels for R and Python codes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants