Giter VIP home page Giter VIP logo

epirhandbook's Introduction

epirhandbook

An R package to provide data and files used in examples in the Epi R Handbook

R-CMD-check CC-BY-NC-SA 4.0

The Epi R Handbook is an open-access R reference manual for applied epidemiologists and public health practitioners.

Installation

You can install the latest version of epirhandbook and view the source code from GitHub with:

install.packages("pacman")
pacman::p_install_gh("appliedepi/epirhandbook")

Or

install.packages("remotes")
remotes::install_git("appliedepi/epirhandbook")

Licence

This work is licensed under a creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License

Read more using the link above or reading the LICENCE

epirhandbook's People

Contributors

aspina7 avatar isaac-florence avatar nsbatra 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

epirhandbook's Issues

34.3 ordered y axis code doesn't change the y-axis order

In the ordered y axis section of 34.3, the below code is used to order the location_name variable, however, this does not work. The location_name variable needs to be converted to a factor first and then fct_relevel will do what is expected.
You'll see that the current figures on the webpage with/without an ordered y-axis are identical.

Maybe also better to put the p_load(forcats) to the start of the chapter rather than in this chunk

`load package
pacman::p_load(forcats)

create factor and define levels manually
agg_weeks <- agg_weeks %>%
mutate(location_name = fct_relevel(
location_name, facility_order$location_name)
)`

font for multilingualisation

I am translating EpiRHandbook to Japanese. But translators of many other languages are interested.

The current Rmd produces plots and maps using ggplot and tmap. This is OK with most Western languages, but may not output texts properly in non-ASCII languages, e.g. Chinese, Japanese and Korean in some cases. Setting font in a theme_* function often solves this issue. But the font family depends on OS.

Below is a sample notebook which works both on macOS and Windows:
http://babayoshihiko.ddns.net/EpiRHandbookBaba/gis.ja.nb.html

Misc tweaks

@isaac-florence
Just adding notes for tweaks (for whenever you get to them). Thank you!!

  • documentation of get_data() - says to write "ALL" when in truth it only accepts "all". Either one is fine, just align.

  • Could you have it say "Run get_data("all") to download all data" in the get_data() yellow box?

  • Likewise in the yellow box for download_book() can you have it state that it is downloading from Github, and instruct the user to run the command with empty parentheses (beginners won't realize that)?

  • On that note, would it slow things down massively if the offline handbook was also a file internal to the package?
    I worry about someone just downloading the package and not realizing they needed to download the handbook before they lost internet access.

Problem with installing R Package of epirhandbook

Hello,

I am trying to install the R Package of epirhandbook from Github using the following command,

library(pacman)
pacman::p_install_gh("appliedepi/epirhandbook")

I get the following message.

The following packages were installed:
epirhandbook
Warning message:
In pacman::p_install_gh("appliedepi/epirhandbook") : The following may have incorrect capitalization specification: epirhandbook

When i try to load the epirhandbook through this command:

pacman::p_load(epirhandbook)

I get the following message:

Warning messages:
1: package ‘epirhandbook’ is not available for this version of R
A version of this package for your version of R might be available elsewhere, see the ideas at https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages
2: In p_install(package, character.only = TRUE, ...) :
3: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, :
there is no package called ‘epirhandbook’
4: In pacman::p_load(epirhandbook) : Failed to install/load:
epirhandbook

I am new to R and I am learning from the online resources how to use R for statistical analysis in public health. I wonder someone will tell me how to deal with the issue to be able to install "epirhandbook".

Note. I have installed pacman library on RStudio. I have followed the steps recommended by the author of the package at https://epirhandbook.com/en/download-handbook-and-data.html

Thank you in advance.

Unnecessary message appearing under section 34.3

Minor point, there is a message appearing just before "Create heat plot" section in section 34.3
It says ## Joining, by = c("location_name", "week") and it appears as code that a user could copy/paste to R.
Probably good to just remove this message.
P

Possible to install data outside of RStudio

Is there a way to get_data("all") outside of RStudio? I (ducks) use either the R CLI or VSCode and neither supports the API completely. Even if just get a link to the files I can probably take care of the rest.

Cannot find the survey data used in 26.2

Are there files available to run through the survey analysis section?
I couldn't find them after installing the handbook/or on github.
It would be helpful if such files were available to ensure users are getting the same results as presented online.

#import the survey data survey_data <- rio::import("survey_data.xlsx")

import the dictionary into R survey_dict <- rio::import("survey_dict.xlsx")

@aspina7

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.