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

Get some simple stats on Fingertips #37

Closed
julianflowers opened this issue Jan 2, 2018 · 5 comments
Closed

Get some simple stats on Fingertips #37

julianflowers opened this issue Jan 2, 2018 · 5 comments
Assignees

Comments

@julianflowers
Copy link

julianflowers commented Jan 2, 2018

Could we add a simple function to extract basic stats on number of profiles/ indicators etc. Janine Dellar wanted these stats and they maybe useful for anyone who wants to know how much there is in Fingertips

`

counts profiles, total published indicators, and distinct indicators in fingertips

fingertips_stats <- function(){

cat("This may take a few moments... ")

require(glue, quietly = TRUE)
require(fingertipsR, quietly = TRUE)

profiles_n <- length(unique(profiles()$ProfileName))
indicatorid_n <- length(unique(indicators()$IndicatorID))
indicators_n <- length(indicators()$IndicatorID)

result <- glue(

"On ",  {format(Sys.Date(), "%d/%m/%Y")}, " Fingertips consisted of ",  {profiles_n},  " profiles, ",
{indicators_n},  " indicators and ", {indicatorid_n}, " distinct indicators."

)

result
}
`

gives
This may take a few moments... On 02/01/2018 Fingertips consisted of 73 profiles, 4559 indicators and 1647 distinct indicators.

@julianflowers
Copy link
Author

Could I do this via a pull request?

@sebastian-fox
Copy link
Member

Yes, can do. I'd prefer to use paste instead of glue as this reduces dependencies on other packages (see comment on predict_indicator() re: rOpenSci.

Otherwise, I can do this for you later today or tomorrow. Let me know if you'd like to do a pull request as practise?

@julianflowers
Copy link
Author

julianflowers commented Jan 8, 2018 via email

@sebastian-fox
Copy link
Member

done (as I want to submit to CRAN) - 6a43c7f

@julianflowers
Copy link
Author

julianflowers commented Feb 2, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants