GithubHelp home page GithubHelp logo

nhs-r-community / intro_r Goto Github PK

View Code? Open in Web Editor NEW
25.0 5.0 25.0 50.71 MB

Workshop materials for revised NHS-R Community "Introduction to R and R Studio" course.

Home Page: https://nhs-r-community.github.io/intro_r/

License: Creative Commons Zero v1.0 Universal

HTML 0.61% CSS 31.30% JavaScript 36.43% R 30.85% Makefile 0.32% Shell 0.49%
training-materials introduction-to-r training

intro_r's Introduction

Welcome to the NHS-R Community Introduction to R and R Studio!

Attending the course?

If you are attending the course check all of our course materials and preparation instructions.

Are you wanting to update or use the slide code?

This repository is split into 3 areas:

  • RMarkdown files and dependency files - slides have been built in {xaringan} which requires the css, img and libs folder to render
  • html pages - are automatically rendered using GitHub actions (no need to knit every file!) and are kept on a separate branch. The html files are published through GitHub and being {xaringan} they are interactive and accessible
  • data files are in a separate repository to help learners access the data files separate to the code for the slides

Set-up

You will need to have R, R tools (on Windows), RStudio, and git installed in order to use this project locally.

Clone the repository, then run the following code chunk to initialise the project.

# the data directory is a git submodule, which needs to be downloaded
if (length(dir("data", ".csv")) == 0) {
  system("git submodule init")
  system("git submodule update")
}
# install all of the required packages
renv::restore()
# download fontawesome icons used in slides
icons::download_fontawesome()

Once you have run these steps, in RStudio you can open the individual Rmarkdown documents and render each file. Alternatively, you can render all of the slides at once using the “Build All” button on the “Build” tab in RStudio.

Spotted a mistake?

Please let us know if there are mistakes or improvements by creating an issue.

intro_r's People

Contributors

andrw-jns avatar chrisbeeley avatar foobar41 avatar lextuga007 avatar maddy020 avatar nebulahh avatar rishav1707 avatar tomjemmett avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

intro_r's Issues

New features in R Studio

I've made references to some of the new features in RStudio (like Rainbow parenthesis) but these need new slides. Also, missing some existing functionality like Session refresh. I add that in often but it would be good to be explicitly covered.

01 Slides error

  • Slides 01 line 387 has a bug needs. Explain GitHub and ROpenSci without icons.
  • Line 358 duplication of tidyverse package call needs to be explained
  • Remove <br> by using two spaces at the end of the previous line
  • Remove italics and use .blue[] for colour definition (italics is not accessible for everyone)
  • Update README with how to install packages that are not on CRAN and fontawesome icons

Many dependencies

Hi,

There are a lot of dependencies. Could you check that they are all needed?

Add negative operators to slide

I've realised there is a lot of positive operators (==) but negatives are not included (!=) and these should be included in the same slide, perhaps with reference elsewhere to other operators like > and <?

Remove some of the repetitive text

As a feature of the slides some of the text is repeated as this looks visually good but will not be good for screen reader users who will have this repeated when it isn't necessary. Some slides require changing around, perhaps using just -- breaks to introduce new information and remove this repetitive text.

GitHub action failed on slide build - icons package

Error:

Run library(icons)
── Installed icons ─────────────────────────────────────────────── icon 0.2.0 ──
✖ ionicons             ✖ google_material 
✖ academicons          ✖ feather_icons   
✖ simple_icons         ✖ octicons        
✖ bioicons             ✖ fontawesome     
! No icons are currently available, start by downloading icons with the download_*() functions.
Error in open.connection(con, "rb") : 
  cannot open the connection to 'https://api.github.com/repos/FortAwesome/Font-Awesome/releases/latest'
Calls: download_fontawesome ... parse_and_simplify -> parseJSON -> parse_con -> open -> open.connection
In addition: Warning message:
In open.connection(con, "rb") :
  cannot open URL 'https://api.github.com/repos/FortAwesome/Font-Awesome/releases/latest': HTTP status was '403 Forbidden'
Execution halted
Error: Process completed with exit code 1.

repackaging the NHS template

Hi there, thank you for the package.
it is really useful and given I do many slides with the branding guidlines for the company I work at. suppose I successfully edited the css file how would I package the whole thing so that I can follow the same steps and generate a slide deck with the same formatting i need

i am a new R coder and would appreciate your guidance

GitHub cannot be viewed by all organisations

A suggestion from a Midlands Analyst Network is to publish through NHS Futures which is a reasonable solution to get around this - particularly for people who are very new to R and want access to the slides.

Add more to the index.rmd and README

Currently the page: https://nhs-r-community.github.io/intro_r/ just has the code to automatically generate the links from the GitHub Action https://github.com/nhs-r-community/intro_r/blob/main/index.Rmd but more information can be added here including details on how to book onto the NHS-R Community course https://nhsrcommunity.com/events/, perhaps the YouTube link too for related workshops:

Part 1 https://www.youtube.com/watch?v=Wmc0GS6gayI
Part 2 https://www.youtube.com/watch?v=N3pIxcCB9K8&t=1s
Part 3 https://www.youtube.com/watch?v=PX316WC0oiU&t=1s

dplyr https://www.youtube.com/watch?v=y5ispDcKfHw&t=1s
RMarkdown https://www.youtube.com/watch?v=UrZsKfNw1wc
ggplot2 https://www.youtube.com/watch?v=jiuDr4aYgkY

Correction - ggsave gives error in ggplot slides

The use of + between the ggplot and ggsave https://nhs-r-community.github.io/intro_r/04-workshop_ggplot2.html#62 causes an error although it also saves and is because it should be a pipe.

It can be run separately where you can ggsave() the last run chart http://www.sthda.com/english/wiki/ggsave-save-a-ggplot-r-software-and-data-visualization but @ChrisBeeley cautioned this practice as it wouldn't work interactively within something like Shiny.

Odd that this error hadn't occurred previously but I've just updated all the packages on the cloud and my own computer.

there is no package called ‘httpuv’

i keep getting the below whenever i need to activate the moon reader feature

could you please help out

Output created: NHS.html
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
there is no package called ‘httpuv’

Accessibility - change "here" to more descriptive link

No specific database section

I suggest that many of the analyst users, and managers, may leave the course thinking they can only get data in as flat files. Database connections are necessary and common in R use. I think a brief intro to DBI and how it works with dplyr would be good here, and I'm happy to adapt it from my NHS-R seminar.

Remove 'Remotes' section from DESCRIPTION

I think we should remove the remotes section from the description file, because it blocks users in Posit Cloud from downloading any packages. They don't have permissions to install from github in that session (no credentials I assume), and it just errors out. This derails you if any packages are missing in their project. E.g. when using readr to import data, a couple of people were missing it but couldn't install until I showed them to delete the remote section.

@Lextuga007 @tomjemmett , what do you think?

Rmd's have different default options

The reports 1-3, 10 & 11 have echo = FALSE, whereas 4-9 have echo = TRUE. This could be confusing for development, so we should look to standardise this across all files.

Update to base R pipe |> from magrittr %>%?

Following the update that's being written for R4DS the move to the base R pipe is recommended which will require updates to the introduction course and materials.

Tagged this as a question as it's open for discussion on which pipe to use/teach.

Space between bullet points

When using NHS-R CSS here, bullet points are very close and overlap because they have paragraph line height. Suggesting increasing them for the li element so bullets are clearly visible.

Indentation error on slide

In the ggplot2 section/Code script the indentation for the first example should have the colour = "red" aligned with the aes() function. Copying and pasting it into an R script should automatically realign or highlighting then using Ctrl+i to indent.

Data file link

The data file link https://github.com/nhs-r-community/intro_r_data/tree/26a2e39bd49d4aa95a8efc5b45c398386e6e4ed4 (which is not directly accessible through the intro_r_data repository https://github.com/nhs-r-community/intro_r_data) only links to a branch where the csv files are. Is that correct or should it be updated with the additional RMarkdown files too? If these modules/branches have two different functions then I suggest an update to the README to explain what the purposes are.

DB exercise download move to data repository?

@chrismainey Should the database exercise and solutions be moved to the data repository where people download the data files? I missed this with the pull request but would be handy, I think, to have everything all together in one download.

Remove <br> code from slides

Many of the slides have
to create line breaks and this can be done in RMarkdown using two spaces at the end of the line to break it up.

Removed:

  • Slide deck 01

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.