aphp / rgho Goto Github PK
View Code? Open in Web Editor NEW:globe_with_meridians:Access WHO Global Health Observatory Data From R
License: GNU General Public License v3.0
:globe_with_meridians:Access WHO Global Health Observatory Data From R
License: GNU General Public License v3.0
I am looking for the female MR aged 44.25 years in Spain.
This is what I get from running my code:
This is what I see in the UI:
Note that the latest data available is 2021, not 2019. In 2019 the death rate was 96.4 per 100.000 individuals. See my code for a reproducible example with a seed in case I am missing something on my side, else this seems to be a bug.
devtools::install_github("aphp/rgho")
library(rgho)
set.seed(42)
# Create a vector of ages (random values between 12 and 75)
ages <- sample(12:75, 20, replace = TRUE)
# Create a vector of genders (random values of 0 or 1)
# 0 is considered male, 1 is considered female
genders <- sample(0:1, 20, replace = TRUE)
# Create the dataframe
patients <- data.frame(age = ages, gender = genders)
print(patients)
# Compute the mean age
mean_age <- mean(patients$age)
print(mean_age)
# Compute the percentage of females
percentage_female <- sum(patients$gender == 1) / nrow(patients) * 100
print(percentage_female)
# compute mortality rate for each gender
mr_fmle = get_who_mr(mean_age, sex="FMLE", country="ESP", local = FALSE)
print(mr_fmle)
mr_mle = get_who_mr(mean_age, sex="MLE", country="ESP", local = FALSE)
print(mr_mle)
Trying to retrieve the latest data available (2021) from WHO in Canada. Mean age is 58 years, sex is female.
This is my code, following the docs:
age = 58
sex = 0
country = "CAN" #Canada
sex_cat = ifelse(sex == 0, "FMLE", "MLE")
mr = get_who_mr(age, sex_cat, local = FALSE, country = country, year="latest")
[1] NA
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.