moj-analytical-services / mojrap Goto Github PK
View Code? Open in Web Editor NEWFor generalised functions for RAP. If there are any functions in your RAP that will be useful to other people, please use this space to share them.
For generalised functions for RAP. If there are any functions in your RAP that will be useful to other people, please use this space to share them.
Travis currently doesn't pass on this repo and haven't had a chance to work out why - see Travis logs. Will probably be unit testing issues.
Hi there
The user george-papadopoulos had Direct Member access to this repository and access via a team.
Access is now only via a team.
You may have less access it is dependant upon the teams access to the repo.
If you have any questions, please post in (#ask-operations-engineering)[https://mojdt.slack.com/archives/C01BUKJSZD4] on Slack.
This issue can be closed.
See reproducible example below:
df <- data.frame("yrqtr" = c("2020 Q1", "2020 Q2", "2020 Q3", "2020 Q4"), "receipts" = seq(40, 10, -10))
mojrap::change(df, "receipts", "yrqtr", "2020 Q1", "2020 Q4", type = "percentage")
[1] "75%"
mojrap::change(df, "receipts", "yrqtr", "2020 Q1", "2020 Q4", type = "absolute")
[1] -30
Not sure if this is intentional? i.e. if you want to call the percentage change, then you need to get the "increased by"/"decreased by" bit alongside it from incdec()
?
@ms130 The mojquarter function isn't working on 31st December where you choose type = "f". I've found a fix to this and will do a pull request.
The functions in this repository would be more useful if they were able to act on a vector, rather than only on a single value. For example, if you wanted to use the format_perc.R function to change fractions to percentages for an entire column, ready for insertion into a publication table.
I have been trying to install the package for use with crown court stats but am not able to download the package using
devtools::install_github("moj-analytical-services/RAP_code_library", auth_token = GITHUB_PAT)
but the function cannot tell that this repo is a package as it gives the following error
Downloading GitHub repo moj-analytical-services/RAP_code_library@master
from URL https://api.github.com/repos/moj-analytical-services/RAP_code_library/zipball/master
Installation failed: Does not appear to be an R package (no DESCRIPTION)
(note: to recreate this you need to generate your own github personal access token and put in place of GITHUB_PAT)
I think this can be fixed by rearranging the file structure of the repo so the DESCRIPTION files etc are on the front page of the repo. Will have a play about with this and open a Pull Request with any changes.
I seem to be getting two values when I unlist()
the results of a call to the connector()
function. Am I using it wrong?
unlist(mojrap::connector(-5, 6))
> [1] ", however there has been"
> [1] ", however there has been"
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.